+ 1

49 Code Project

I need help in C# code project 49 on arrays and strings, what code did you implement there?

19th May 2022, 10:17 PM
Andrey
3 Réponses
+ 3
Thank you so much
20th May 2022, 1:30 AM
Andrey
+ 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.
19th May 2022, 11:55 PM
Brian
Brian - avatar
0
bool IsMatch = false; foreach (string w in words) { if(w.Contains(letter)) { Console.WriteLine(w); IsMatch = true; } } if (!IsMatch) Console.WriteLine("No match");
20th May 2022, 12:47 AM
SoloProg
SoloProg - avatar