MathGroup Archive 2006

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

Search the Archive

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


Hi Nasser,
You want to print a list without the enclosing curly brackets. For this, 
you could define a format of your own. This can be achieved by wrapping 
your expression into some function, say myFormat, and define a format 
for this function. E.g.:
Format[myFormat[x__]]:=StringTake[ToString[{x}],{3,-3}]
now, if you say: myFormat[e] yout get: a, {b}

Daniel

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
> 


  • Prev by Date: Re: How to remove just the outermost braces of a list?
  • Next by Date: Re: Program to calculate rational function with imbedded continued fraction
  • Previous by thread: RE: How to remove just the outermost braces of a list?
  • Next by thread: Re: How to remove just the outermost braces of a list?