开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜