CSharp examples for System:String Strip
Remove Vowels from String
using System.Text.RegularExpressions; using System.Text; using System.Globalization; using System.Collections.Generic; using System;//from www . ja va 2s. c o m public class Main{ public static string RemoveVowels(string input) { string ret = ""; string currentLetter; for (int i = 0; i < input.Length; i++) { currentLetter = input.Substring(i, 1); if (String.Compare(currentLetter, "a", true) != 0 && String.Compare(currentLetter, "e", true) != 0 && String.Compare(currentLetter, "i", true) != 0 && String.Compare(currentLetter, "o", true) != 0 && String.Compare(currentLetter, "u", true) != 0) { //Not a vowel, add it ret += currentLetter; } } return ret; } }