Created
June 13, 2016 11:39
-
-
Save antonshkurenko/8613d105665bd2a3f9c2132fd5ca6cf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> String toDelimitedString(List<T> list, String delimiter) { | |
final StringBuilder strb = new StringBuilder(); | |
for (T t : list) { | |
strb.append(String.valueOf(t)).append(delimiter); | |
} | |
return strb.substring(0, strb.length() - delimiter.length()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment