Forked from CaptainBern/gist:00e688511957ed442fdb
Last active
August 29, 2015 14:02
-
-
Save CeramicTitan/427b37e90925fcbcff57 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 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