Mega Code Archive

 
Categories / VB.Net / Language Basics
 

Appends various data to StringBuilder

Imports System.Text Class Sample    Public Shared Sub Main()       Dim obj As [Object] = 0       Dim xBool As Boolean = True       Dim xByte As Byte = 1       Dim xInt16 As Short = 2       Dim xInt32 As Integer = 3       Dim xInt64 As Long = 4       Dim xDecimal As [Decimal] = 5       Dim xSingle As Single = 6.6F       Dim xDouble As Double = 7.7       Dim xUInt16 As UShort = 8       Dim xUInt32 As UInteger = 9       Dim xUInt64 As ULong = 10       Dim xSByte As SByte = -11       '       Dim sb As New StringBuilder()       sb = sb.Append(xBool)       sb = sb.Append(obj).Append(xByte)       sb = sb.Append(xInt16)       sb = sb.Append(xInt32)       sb = sb.Append(xInt64)       sb = sb.Append(xDecimal)       sb = sb.Append(xSingle).Append(xDouble)       sb.Append(xUInt16)       sb.Append(xUInt32).Append(xUInt64)       sb.Append(xSByte)       Dim str As [String] = sb.ToString()       Console.WriteLine(str)    End Sub  End Class