StringReader Class

July 28, 2014

Implements a TextReader that reads from a string.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

public class StringReader : TextReader

The StringReader type exposes the following members.

  NameDescription
Public methodStringReaderInitializes a new instance of the StringReader class that reads from the specified string.
Top

  NameDescription
Public methodCloseCloses the StringReader. (Overrides TextReader.Close().)
Public methodDispose()Releases all resources used by the TextReader object. (Inherited from TextReader.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the StringReader and optionally releases the managed resources. (Overrides TextReader.Dispose(Boolean).)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodPeekReturns the next available character but does not consume it. (Overrides TextReader.Peek().)
Public methodRead()Reads the next character from the input string and advances the character position by one character. (Overrides TextReader.Read().)
Public methodRead(Char[], Int32, Int32)Reads a block of characters from the input string and advances the character position by count. (Overrides TextReader.Read(Char[], Int32, Int32).)
Public methodReadAsyncReads a specified maximum number of characters from the current string asynchronously and writes the data to a buffer, beginning at the specified index. (Overrides TextReader.ReadAsync(Char[], Int32, Int32).)
Public methodReadBlockReads a maximum of count characters from the current stream, and writes the data to buffer, beginning at index. (Inherited from TextReader.)
Public methodReadBlockAsyncReads a specified maximum number of characters from the current string asynchronously and writes the data to a buffer, beginning at the specified index. (Overrides TextReader.ReadBlockAsync(Char[], Int32, Int32).)
Public methodReadLineReads a line from the underlying string. (Overrides TextReader.ReadLine().)
Public methodReadLineAsyncReads a line of characters asynchronously from the current string and returns the data as a string. (Overrides TextReader.ReadLineAsync().)
Public methodReadToEndReads the stream as a string, either in its entirety or from the current position to the end of the stream. (Overrides TextReader.ReadToEnd().)
Public methodReadToEndAsyncReads all characters from the current position to the end of the string asynchronously and returns them as a single string. (Overrides TextReader.ReadToEndAsync().)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Show:
© 2014 Microsoft