Skip to content

Instantly share code, notes, and snippets.

@korzha
Created May 16, 2013 13:55
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 korzha/5591909 to your computer and use it in GitHub Desktop.
Save korzha/5591909 to your computer and use it in GitHub Desktop.
public static String toPath(String... names) {
StringBuilder sb = new StringBuilder(getCharCount(names) + names.length - 1);
for (String s : names) {
sb.append(s).append(File.separator);
}
if (sb.length() > 0) {
sb.deleteCharAt(sb.length() - 1);
}
return sb.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment