Mega Code Archive

 
Categories / VB.Net Tutorial / Data Type
 

Demonstrating StringBuilder Append methods

Imports System.Text Imports System.Windows.Forms Module modBuilderAppend    Sub Main()       Dim objectValue As Object = "hello"       Dim stringValue As String = "good bye"       Dim characterArray As Char() = {"a"c, "b"c, "c"c, "d"c, "e"c, "f"c}       Dim booleanValue As Boolean = True       Dim characterValue As Char = "Z"c       Dim integerValue As Integer = 7       Dim longValue As Long = 1000000       Dim singleValue As Single = 2.5       Dim doubleValue As Double = 33.333       Dim buffer As StringBuilder = New StringBuilder()       buffer.Append(objectValue)       buffer.Append("  ")       buffer.Append(stringValue)       buffer.Append("  ")       buffer.Append(characterArray)       buffer.Append("  ")       buffer.Append(characterArray, 0, 3)       buffer.Append("  ")       buffer.Append(booleanValue)       buffer.Append("  ")       buffer.Append(characterValue)       buffer.Append("  ")       buffer.Append(integerValue)       buffer.Append("  ")       buffer.Append(longValue)       buffer.Append("  ")       buffer.Append(singleValue)       buffer.Append("  ")       buffer.Append(doubleValue)       Console.WriteLine("buffer = " & buffer.ToString())    End Sub End Module buffer = hello good bye abcdef abc True Z 7 1000000 2.5 33.333