Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6462
| From | leigh pascoe <leigh@evry.inserm.fr> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Converting a list of strings to a single space-delimited string |
| Date | 2011-11-16 09:44 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <ja00l6$5ur$1@smc.vnet.net> (permalink) |
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
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Converting a list of strings to a single space-delimited string leigh pascoe <leigh@evry.inserm.fr> - 2011-11-16 09:44 +0000
csiph-web