How to remove vowels from a string in C#

1 Answer

0 votes
using System;
using System.Text.RegularExpressions;

class Program
{
    static String remove_vowels(String str) {
        return Regex.Replace(str, "[aeiouAEIOU]", "");;
    }

    static void Main() {
        String str = "C++ C-Sharp PHP Java Python VB.NET Rust";

        Console.Write(remove_vowels(str));
    }
}




/*
run:

C++ C-Shrp PHP Jv Pythn VB.NT Rst

*/

 



answered Nov 21, 2022 by avibootz

Related questions

1 answer 239 views
239 views asked Jun 22, 2019 by avibootz
1 answer 212 views
1 answer 223 views
223 views asked Nov 21, 2022 by avibootz
1 answer 236 views
1 answer 231 views
1 answer 211 views
1 answer 228 views
228 views asked Mar 27, 2022 by avibootz
...