string substitute characters java code example
Example 1: java replace character in string
String s = "new String";
String replaced = s.replace("new","Test");
^ ^
old new char
Example 2: java replaceall single character
.replaceAll("(?<!\\S)[^ ](?!\\S)", " ").trim()