Skip to content

Instantly share code, notes, and snippets.

@Alex-Bond
Created February 14, 2014 10:36
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 Alex-Bond/8999010 to your computer and use it in GitHub Desktop.
Save Alex-Bond/8999010 to your computer and use it in GitHub Desktop.
public static String combineSplit(int startIndex, String[] string, String seperator) {
StringBuilder builder = new StringBuilder();
if (string.length >= 1) {
for (int i = startIndex; i < string.length; i++) {
builder.append(string[i]);
builder.append(seperator);
}
if (builder.length() > seperator.length()) {
builder.deleteCharAt(builder.length() - seperator.length());
return builder.toString();
}
}
return "";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment