Hi and welcome to DIC! Removing vowels from a String can be done the following way:
CODE
String sentence = "Hello world";
sentence = sentence.replace("a", "");
sentence = sentence.replace("e", "");
sentence = sentence.replace("i", "");
sentence = sentence.replace("o", "");
sentence = sentence.replace("u", "");
System.out.println(sentence); //Hll wrld
The replace(String a, String B ) method of the String class replaces all occurences of argument 1 by the second argument. This way, you can remove a certain character or word from the initial String. This object is immutable, meaning it does not change its state and you must assign the returned value to the initial String, like:
CODE
String a = a.replace("a", ""); //a will have its "a" characters removed.
If you need more help then just reply.
Hope this helps.
This post has been edited by alpha02: 18 Sep, 2007 - 05:27 PM