Try flipping your if and your for loop.

Do a for loop first so you can iterate each word one at a time. That is, it’ll loop for “home”, “programming”, “victor”, and so on.
Then for each word, do a Contains on it for the letter.
Right now you’re calling Contains on the collection of words. To put it another way, let’s say I had you a literal physical dictionary book. And asked you “using this dictionary, does it contain ‘z’?”

It’s kind of the wrong question isn’t it?
If instead, I pointed you page 50, and asked, “Which of these words contain the letter ‘z’?” then that’s a bit more meaningful.
To help you along:

Here you go, grasshopper. Merry Christmas 😉

source

Categories: CodingCsharp