public class StringExample2 { public static void main(String[] args) { //Let's remove all the e's from a String String st = "Fred ate every egg."; for(int x = 0; x < st.length(); x++) { if(st.charAt(x)=='e') st = st.substring(0, x) + st.substring(x+1); } System.out.println(st); } }