Answers for "write a java program to find a character from a sentence and replace it with another character"

3

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);
Posted by: Guest on August-14-2020

Code answers related to "write a java program to find a character from a sentence and replace it with another character"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language