How to use StringBuilder in VB.NET

3 Answers

0 votes
Imports System
Imports System.Text

Module Module1

    Sub Main()

        Dim sb As New StringBuilder

        sb.Append("VB.NET,")
        sb.Append("C#")

        sb.AppendLine()

        sb.Append("PHP,")

        sb.Append("Java").AppendLine()

        Dim s As String = sb.ToString

        Console.WriteLine(s)

    End Sub

End Module

' run:
' 
' VB.NET,C#
' PHP, Java

 



answered Sep 24, 2018 by avibootz
edited Nov 18, 2019 by avibootz
0 votes
Imports System
Imports System.Text

Module Module1

    Sub Main()

        Dim sb As New StringBuilder("VB.NET")

        Dim s As String = sb.ToString

        Console.WriteLine(s)

    End Sub

End Module

' run:
' 
' VB.NET

 



answered Sep 24, 2018 by avibootz
edited Nov 18, 2019 by avibootz
0 votes
Imports System
Imports System.Text
				
Public Module Module1
	Public Sub Main()
		Dim sb As New StringBuilder("VB.NET")
		
		sb(0) = "G"
 
        Dim s As String = sb.ToString
		
		Console.WriteLine(s)
	End Sub
End Module

 
' run:
' 
' GB.NET

 



answered Nov 18, 2019 by avibootz

Related questions

1 answer 159 views
1 answer 121 views
1 answer 141 views
1 answer 141 views
1 answer 117 views
1 answer 114 views
...