Created
April 21, 2017 06:55
-
-
Save truongngoclinh/36232b2af6b3dc86ef295fccefa14ed5 to your computer and use it in GitHub Desktop.
add space between chars
This file contains hidden or 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
// 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