Using StringReader : StringReader « String « C# / CSharp Tutorial






using System;
using System.IO;

public class MainClass
{
  static void Main(string[] args)
  {
    String MyString = "Hello World";

    char[] MyChar = new char[12];

    StringReader MyStringReader = new StringReader(MyString);

    MyStringReader.Read(MyChar, 0, 5);

    Console.WriteLine(MyChar);

    MyStringReader.Close();
  }
}








5.22.StringReader
5.22.1.Using StringReader
5.22.2.Reading from a string
5.22.3.Reading from a string one line at a time