To read a String to Textreader using C# and VB.NET you can use the snippet below.

Sample C#

using(TextReader textReader = new StringReader("string"))
{
    //...
}

Sample VB.NET

Using textReader As TextReader = New StringReader("string")
    '...
End Using

Leave a Reply