title: How to remove character from string without any built in method in Java neither I want to use stringbuilder or string buffer
body: <p>Can anyone tell me how to remove character from string without any use of built-in functions and stringbuffer or builder. Although I tried to form a logic but didn't get the answer. As in below code I want to remove 'he' from the inputstring.</p>
  
  <pre><code>import java.util.Scanner;
  public class p1 {
      public static void main(String[] rgs) {
          System.out.println("enter the string");
          Scanner s = new Scanner(System. in );
          String str = s.nextLine();
          p1 g = new p1();
          g.replacechar(str);
      }
      public void replacechar(String str) {
          String e = "";
          int l = str.length();
          char ch[] = str.toCharArray();
          for (int i = 0; i &lt; l; i++) {
              if (ch[i] == 'h' &amp;&amp; ch[i + 1] == 'e') {
                  ch[i] = ' ';
                  ch[i + 1] = ' ';
                  e += ch[i];
              } else {
                  System.out.println("no ");
                  break;
              }
          }
          System.out.println(e);
      }
  }
  </code></pre>