阅读量:3
您可以使用以下VB代码将字符串顺序倒置:
```vb
Public Function ReverseString(ByVal str As String) As String
Dim reversedStr As String = ""
For i As Integer = str.Length - 1 To 0 Step -1
reversedStr &= str(i)
Next
Return reversedStr
End Function
```
您可以使用以下代码测试:
```vb
Dim str As String = "Hello World!"
Dim reversedStr As String = ReverseString(str)
MessageBox.Show(reversedStr)
```
运行此代码将弹出一个对话框,显示倒置后的字符串"!dlroW olleH"。