Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Re: Converting a list of strings to a single space-delimited string

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122908] Re: Converting a list of strings to a single space-delimited string
  • From: leigh pascoe <leigh at evry.inserm.fr>
  • Date: Wed, 16 Nov 2011 04:43:31 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com


Le 10/11/2011 12:53, Andrew DeYoung a =C3=A9crit :
> Hi,
>
> I know that the command StringSplit can be used to convert a single
> space-delimited string to a list of strings.  For example,
>
> B == "1 2 3";
> mylist == StringSplit[B]
>
> gives a list mylist such that mylist == {"1", "2", "3"}.
>
> But what if I would like to go in the reveres direction -- convert
> {"1", "2", "3"} to "1 2 3"?  Is there a good way to do this, other
> than using a For loop and concatenating the elements of the list
> together?
>
> Thanks so much.
>
> Andrew DeYoung
> Carnegie Mellon University
>
>
StringJoin[Riffle[mylst, " "]]

LP



  • Prev by Date: Outputting Plots as Text
  • Next by Date: Re: Text Kerning
  • Previous by thread: Re: Converting a list of strings to a single space-delimited string
  • Next by thread: nested findroot