1. Course
  2. Text Files A
  3. Search lines in a text file

Search lines in a text file

Last updated: 8/23/2020 Difficulty: Intermediate

Create a C# program that reads the contents of a text file and stores it in an array of strings.

Then ask the user for words or phrases until you enter an empty text. Each time the user enters a word or phrase, it shows the lines that match the text, provided it is not empty.



vulputate himenaeos. Venenatis dapibus congue quis aptent tincidunt vivamus
fermentum eu libero eros nullam varius curabitur, ligula et sem sapien eget fringilla
euismod justo sociis malesuada aliquet leo pretium nullam ullamcorper vitae nostra mi 


Text Files A

4 / 6

Android App

Practice C# anywhere with the free app for Android devices.

Android App

Exercises C# by difficulty

Learn C# at your own pace, the exercises are ordered by difficulty.