+ 1
49 Code Project
I need help in C# code project 49 on arrays and strings, what code did you implement there?
3 Réponses
+ 3
Thank you so much
+ 1
I used foreach to iterate through the words in the array, and .Contains to determine whether the letter is found in each word. Also I used a counting variable to track whether any words were found within the loop.
0
bool IsMatch = false;
foreach (string w in words) {
if(w.Contains(letter)) {
Console.WriteLine(w);
IsMatch = true;
}
}
if (!IsMatch) Console.WriteLine("No match");