Suppose I have the following string list:


how can I turn this to

{{"a dog"},{"the pen"}}

I tried StringJoin yet that gives

  • $\begingroup$ Look at StringRiffle. $\endgroup$ – Jason B. Nov 29 '18 at 17:26
  • $\begingroup$ @JasonB. I have but that does not a list format. $\endgroup$ – Wiliam Nov 29 '18 at 17:29
  • $\begingroup$ even if I do {l // StringRiffle} I get {"a dog\nthe pen"} $\endgroup$ – Wiliam Nov 29 '18 at 17:30
List /@ StringRiffle /@ l

{{"a dog"}, {"the pen"}}

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.