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 234 views
234 views asked Jun 22, 2019 by avibootz
1 answer 207 views
1 answer 219 views
219 views asked Nov 21, 2022 by avibootz
1 answer 233 views
1 answer 226 views
1 answer 206 views
1 answer 222 views
222 views asked Mar 27, 2022 by avibootz
...