Skip to content

Instantly share code, notes, and snippets.

@jinwood
Created January 26, 2015 21:08
Show Gist options
  • Save jinwood/b2860032c92bdba20a4f to your computer and use it in GitHub Desktop.
Save jinwood/b2860032c92bdba20a4f to your computer and use it in GitHub Desktop.
Disemvoweler
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disemvoweler
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Disemvoweler!\n");
Console.WriteLine("Enter word to disemvowel!");
var myWord = Console.ReadLine();
char[] vowels = { 'a', 'e', 'i', 'o', 'u' };
List<char> charList = new List<char>(myWord.ToCharArray());
for (int i = 0; i < vowels.Length; i++)
{
while (charList.Contains(vowels[i]))
{
charList.Remove(vowels[i]);
}
}
Console.WriteLine(string.Join("", charList));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment