Opposite of String.Split with separators (.net)

robintw picture robintw · Jan 18, 2009 · Viewed 38.2k times · Source

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

robintw picture robintw · Jan 18, 2009

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