登錄站點

用戶名

密碼

StringBuilder 1

3已有 75 次閱讀  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
        Next
        MsgBox(x.ToString())
    End Sub
分享 舉報