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)
The String class requires a reverse() function, hence first convert the input string to a StringBuffer, using the StringBuffer method. Then use the reverse() method to reverse the string.
Reverse a String using String Builder / String Buffer Class. StringBuffer and StringBuilder comprise of an inbuilt method reverse() which is used to reverse the characters in the StringBuffer. This method replaces the character sequence in the reverse order.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With