Created
January 26, 2015 21:08
-
-
Save jinwood/b2860032c92bdba20a4f to your computer and use it in GitHub Desktop.
Disemvoweler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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