A method to reverse effect of java String.split()?

javaphild  picture javaphild · Apr 27, 2009 · Viewed 131.7k times · Source

I am looking for a method to combine an array of strings into a delimited String. An opposite to split().

Wanted to ask the forum before I try writing my own (since the JDK has everything)

Answer

John Topley picture John Topley · Apr 27, 2009

There's no method in the JDK for this that I'm aware of. Apache Commons Lang has various overloaded join() methods in the StringUtils class that do what you want.