StringBuilder 1
熱3已有 1087 次閱讀 2017-04-17 23:10 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As New System.Text.StringBuilder '不用imports System.Text
For i As Integer = 0 To 4
x.Append(ListBox1.Items(i))
If i < ListBox1.Items.Count - 1 Then
x.Append(" , " & vbCrLf)
Else
x.Append(" . ")
End If
Dim x As New System.Text.StringBuilder '不用imports System.Text
For i As Integer = 0 To 4
x.Append(ListBox1.Items(i))
If i < ListBox1.Items.Count - 1 Then
x.Append(" , " & vbCrLf)
Else
x.Append(" . ")
End If
Next
MsgBox(x.ToString())
End Sub
MsgBox(x.ToString())
End Sub
發表評論 評論 (0 個評論)