C# StringReader StringReader

Description

StringReader StringReader Initializes a new instance of the StringReader class that reads from the specified string.

Syntax

StringReader.StringReader has the following syntax.


public StringReader(
  string s
)

Parameters

StringReader.StringReader has the following parameters.

  • s - The string to which the StringReader should be initialized.

Example


/*from  ww w  .ja  v  a  2  s . c  om*/
using System;
using System.IO;
public class MainClass{
  public static void Main(String[] argv){  
    string aLine, aParagraph = null;
    StringReader strReader = new StringReader("java2s.com");
    while(true)
    {
        aLine = strReader.ReadLine();
        Console.WriteLine(aLine);
    }

  }
}
    




















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter