Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to remove just the outermost braces of a list?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69917] Re: [mg69876] How to remove just the outermost braces of a list?
  • From: János <janos.lobb at yale.edu>
  • Date: Wed, 27 Sep 2006 06:05:21 -0400 (EDT)
  • References: <200609260921.FAA08008@smc.vnet.net>

On Sep 26, 2006, at 5:21 AM, Nasser Abbasi wrote:

> hello
>
> I thought this will be easy, but I can't seem to find an easy way  
> to do the
> following.
>
> e={a,{b}}
> Print[e]  ------> This will print {a,{b}}
>
> What can I do to make it print   a,{b}  ?
>
> Flatten does not do it.  TableForm came close, but it removes all  
> braces,
> not just the outermost.
>
> Many times I get a list as a result which I want to print, but I do  
> not want
> the outermost braces to be displayed as well. I want to display  
> just the
> content of the list.
>
> thanks,
> Nasser

Here is a very newbie approach:

In[23]:=
StringJoin[ToString[e[[1]]],
   ",", ToString[e[[2]]]]
Out[23]=
"a,{b}"

János


----------------------------------------------
Trying to argue with a politician is like lifting up the head of a  
corpse.
(S. Lem: His Master Voice)


  • Prev by Date: Performance comparison Mac OSX vs. Windows XP
  • Next by Date: Re: How to remove just the outermost braces of a list?
  • Previous by thread: How to remove just the outermost braces of a list?
  • Next by thread: Re: How to remove just the outermost braces of a list?