21

I'm super new to any sort of programming, so forgive my ignorance for not knowing how to do something that seems so simple.

All I'd like to do is take any array of strings (call it name), let's say:

["John", "Charles", "Smith"]

and remove it from the list and turn it into a string:

John Charles Smith

I can't seem to get my head around this and couldn't find a similar post.

cccg03
  • 319
  • 1
  • 2
  • 5

1 Answers1

51

Just use:

" ".join(["John", "Charles", "Smith"])
projetmbc
  • 1,332
  • 11
  • 26
  • I had actually tried that, but for some reason I was getting back the strings still in a list but now with a space, i.e. ["John Charles Smith"]. I made a small adjustment however and this time it worked. Thanks! – cccg03 Mar 18 '16 at 22:09
  • What was that small adjustment you made @cccg03? – Gunner Stone Feb 15 '22 at 21:46