Click here to Skip to main content
15,918,193 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to remove vowels from a string but it replaces all characters except for one.........

here is my code

C#
package string;

public class MainString {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        String s  = "This is a string";
        //s.replaceAll("aeiou", "");
        removevowels(s);

    }
public static void removevowels(String s)
{
    String s1 = s.replaceAll("[aeiou](?!\\b)", "");
    //String s1 = s.replaceAll("aeiou", "");
    System.out.println(s1);
}
}
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900