StringBuilder.AppendFormat Method
Imports System
Imports System.Text
Imports System.Globalization
Class Sample
Private Shared sb As New StringBuilder()
Public Shared Sub Main()
Dim var1 As Integer = 111
Dim var2 As Single = 2.22F
Dim var3 As String = "abcd"
Dim var4 As Object() = {3, 4.4, "X"c}
sb.AppendFormat("1) {0}", var1)
sb.AppendFormat("2) {0}, {1}", var1, var2)
sb.AppendFormat("3) {0}, {1}, {2}", var1, var2, var3)
sb.AppendFormat("4) {0}, {1}, {2}", var4)
Dim ci As New CultureInfo("es-ES", True)
sb.AppendFormat(ci, "5) {0}", var2)
End Sub
Public Shared Sub Show(sbs As StringBuilder)
Console.WriteLine(sbs.ToString())
sb.Length = 0
End Sub
End Class
Related examples in the same category