Create StringWriter class that writes to the specified StringBuilder. : StringWriter « File Directory « VB.Net






Create StringWriter class that writes to the specified StringBuilder.

 

Imports System
Imports System.IO
Imports System.Text

Public Class StrWriter
    Shared Sub Main()
        Dim strBuilder As New StringBuilder("file path characters are: ")
        Dim strWriter As New StringWriter(strBuilder)

        strWriter.Write(Path.InvalidPathChars, 0, Path.InvalidPathChars.Length)

        strWriter.Close()
        strBuilder.Insert(0, "Invalid ")
        Console.WriteLine(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.