Friday, 22 April 2016

[Java 8] StringJoiner


StringJoiner
Utility method to construct a string with desired delimiter

StringJoiner strJoiner = new StringJoiner(",");
strJoiner.add("Hello").add("Bye");
System.out.println(strJoiner);

// Hello,Bye

No comments:

Post a Comment

Note: only a member of this blog may post a comment.