Skip to content

Instantly share code, notes, and snippets.

@truongngoclinh
Created April 21, 2017 06:55
Show Gist options
  • Save truongngoclinh/36232b2af6b3dc86ef295fccefa14ed5 to your computer and use it in GitHub Desktop.
Save truongngoclinh/36232b2af6b3dc86ef295fccefa14ed5 to your computer and use it in GitHub Desktop.
add space between chars
// add double spaces
public String addSpacesBetweenChar(String str) {
if (!str.contains("*")) {
str = "******" + str;
}
return str.replaceAll(".(?=.)", "$0 ");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment