Skip to content

Instantly share code, notes, and snippets.

@CeramicTitan
Forked from CaptainBern/gist:00e688511957ed442fdb
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CeramicTitan/427b37e90925fcbcff57 to your computer and use it in GitHub Desktop.
Save CeramicTitan/427b37e90925fcbcff57 to your computer and use it in GitHub Desktop.
public String format(List<String> list){
boolean isFirst = true;
StringBuilder sb = new StringBuilder();
for(String entry : list) {
if (isFirst) {
isFirst = false;
} else {
sb.append(",");
}
sb.append(entry);
}
return sb.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment