From TRCCompSci - AQA Computer Science
1 Console.WriteLine("please enter a word:");
2 string word = Console.ReadLine();
3 Console.WriteLine("please enter part of the word:");
4 string part = Console.ReadLine();
5
6 if(word.Contains(part))
7 {
8 Console.WriteLine("Part found");
9 }
10 else
11 {
12 Console.WriteLine("Part not found: ");
13 }
14
15 Console.ReadLine();
1 Console.WriteLine("please enter a word:");
2 string word = Console.ReadLine();
3 string vowels = "aeiou";
4
5 foreach(char c in word)
6 {
7 if(vowels.Contains(c.ToString()))
8 {
9 Console.WriteLine("Vowel found: "+c);
10 }
11 }
12
13 Console.ReadLine();