Create StringWriter class. : StringWriter « File Directory « VB.Net






Create StringWriter class.

 

Imports Microsoft.VisualBasic
Imports System
Imports System.IO
Imports System.Text

Public Class StrWriter
    Shared Sub Main()
        Dim strWriter As StringWriter = new StringWriter()
        strWriter.Write("file path characters are: ")
        strWriter.Write(Path.InvalidPathChars, 0, Path.InvalidPathChars.Length)
        strWriter.Write("."C)

        strWriter.GetStringBuilder().Insert(0, "Invalid ")

        Console.WriteLine(strWriter.Encoding.EncodingName, strWriter.ToString())

    End Sub
End Class

   
  








Related examples in the same category

1.Use a StringWriter to write into a stringUse a StringWriter to write into a string
2.Create StringWriter class with the specified format control.
3.Create StringWriter class that writes to the specified StringBuilder.