Java equivalents of C# String.Format() and String.Join()

Omar Kooheji picture Omar Kooheji · Oct 9, 2008 · Viewed 75.4k times · Source

I know this is a bit of a newbie question, but are there equivalents to C#'s string operations in Java?

Specifically, I'm talking about String.Format and String.Join.

Answer

Grant Wagner picture Grant Wagner · Oct 9, 2008

The Java String object has a format method (as of 1.5), but no join method.

To get a bunch of useful String utility methods not already included you could use org.apache.commons.lang.StringUtils.