MathGroup Archive 2006

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

Search the Archive

Re: Decompose string into list

  • To: mathgroup at
  • Subject: [mg64102] Re: [mg64079] Decompose string into list
  • From: Pratik Desai <pdesai1 at>
  • Date: Wed, 1 Feb 2006 04:34:43 -0500 (EST)
  • References: <>
  • Sender: owner-wri-mathgroup at

Renan wrote:

>I can make a string from a list, using:
>In[1]:= StringJoin @@ {"F", "o", "o", " ", "b", "a", "r"}
>Out[1]:= Foo bar
>But I want to "decompose" a string into a list composed by its elements, e.g.
>"Foo bar" turns back into {"F", "o", "o", " ", "b", "a", "r"}
>"Hello" turns back into {"H","e","l","l","o"}.
>How to do this? Mathematica 5.2 on Windows.
How about something like this
list={"F", "o", "o", " ", "b", "a", "r"};
f[list_?ListQ]:=StringJoin @@ {list}

{"F", "o", "o", " ", "b", "a", "r"}

Hope this helps pratik

  • Prev by Date: Singularities at end point in integrations...
  • Next by Date: Re: How to get range of InterpolatingFunction?
  • Previous by thread: Re: Decompose string into list
  • Next by thread: Contour Plot from a non matrix data