6 Replies Latest reply: Aug 25, 2007 1:02 PM by 3004 RSS

    Deletion of Characters in String

    807600
      Hi I having a problem. Below shows

      String s = "Hello";
      for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) != 'e' && s.charAt(i) != 'o') {
      System.out.print(s.charAt(i));
      }
      }

      If I want to let user to key in the string and the program will be able to delete the 'e' and the 'o'. How do I do that?