C# program to demonstrate StringReader class
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to demonstrate the StringReader class is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created a class Program that contains data member str that contains multiple lines of data. The Program class also contains two static methods ReadLines() and Main().
In the ReadLines() method, we read the data line by line from data member str using ReadLine() method of StringReader class and print on the console screen.
The Main() method is the entry point of the program, here we called the static method ReadLines().
need an explanation for this answer? contact us directly to get an explanation for this answer