C# StringReader Read()

Description

StringReader Read() Reads the next character from the input string and advances the character position by one character.

Syntax

StringReader.Read() has the following syntax.


public override int Read()

Returns

StringReader.Read() method returns The next character from the underlying string, or -1 if no more characters are available.

Example


using System;//from  w w w . j a va 2  s  . c  o  m
using System.IO;
public class MainClass{
  public static void Main(String[] argv){  
    StringReader strReader = new StringReader("java2s.com");
    Console.WriteLine(strReader.Read());
  }
}




















Home »
  C# Tutorial »
    System.IO »




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