在VB中,可以使用&操作符或者使用+操作符拼接字符串。
例如:
Dim str1 As String = "Hello"Dim str2 As String = "World"' 使用&操作符拼接字符串Dim result1 As String = str1 & " " & str2Console.WriteLine(result1) ' 输出:Hello World' 使用+操作符拼接字符串Dim result2 As String = str1 + " " + str2Console.WriteLine(result2) ' 输出:Hello World另外,还可以使用String.Concat方法或者String.Format方法拼接字符串。
例如:
Dim str1 As String = "Hello"Dim str2 As String = "World"' 使用String.Concat方法拼接字符串Dim result1 As String = String.Concat(str1, " ", str2)Console.WriteLine(result1) ' 输出:Hello World' 使用String.Format方法拼接字符串Dim result2 As String = String.Format("{0} {1}", str1, str2)Console.WriteLine(result2) ' 输出:Hello World 
