In java how I can delete Vowels are 'a', 'e', 'i', 'o' and 'u
How can I delete vowels from a String except the vowel at the end of word?
For example "Please come to my party"
To return "Plse cme to my 开发者_运维百科prty"
string.replaceAll("[aeiou]\\B", "")
Reads: Match all vowels ([aeiou]
) that are not followed by an "end of word" (\\B
). For more information read the Javadoc on java.util.regex.Pattern
Turn the String into a char array.
Iterate through it.
Append each character to a StringBuilder, unless the next character is an alphabetic character.
精彩评论