how to replace some chars in the string with other chars by the user?
<p>I wrote a text, and i want to change some chars to any other chars which the user will choosing them, I tried and couldn't find the correct answer, so please guide me.
the code in the MyTest Class is:</p>

<pre><code>public String replace(String input,char from,char to){
   String input2 ="";
   String input3="";
   this.input=input3;
   for(int i=0;i&lt;input.length();i++){
       for(int j=0;j&lt;input3.length();j++){
          if(input.charAt(i)==input3.charAt(j)){
              input2=input3.replace(from, to);
              System.out.println(input2);
          }
       }

   }
   return input2;
}
</code></pre>

<p>And the code in the Main Class:</p>

<pre><code>System.out.println("please enter the new character: ");
   char c1 = scan.next().charAt(0);
   System.out.println("Please choose the letters that you want to change it which in the text:");
   String ltr = scan.next();
   obj1.convertChars(ltr, c1);
</code></pre>
