How do I print out the words in a file which startswith b in C#?


#1

Here is the code:

Reader r = new Reader();
            string s = "b";
            string path = @"randomtext.txt";
            foreach(string word in Reader.GetWords(path))
            {
                if (word.StartsWith(s))
                {                  
                    Console.WriteLine("{0} ", word);
                }   
            }

#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.