char replace char code example
Example 1: how to replace all of one character with nothing in java
String meal = "Hambbburger";
String replaced = meal.replaceAll("b","");
Example 2: replace character in string java
String str = "..............................";
int index = 5;
char ch = '|';
StringBuilder string = new StringBuilder(str);
string.setCharAt(index, ch);
System.out.println(string);