Tuesday, 23 January 2018

c# - Opposite of String.Split with separators (.net)



Is there a way to do the opposite of String.Split in .Net? That is, to combine all the elements of an array with a given separator.




Taking ["a", "b", "c"] and giving "a b c" (with a separator of " ").



UPDATE: I found the answer myself. It is the String.Join method.


Answer



Found the answer. It's called String.Join.


No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...