2014-10-22 34 views

回答

2

使用MOD運營商決定何時插入回車。

Option Strict On 
Option Explicit On 
Option Infer Off 
Public Class Form1 
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 
     Dim sb As New System.Text.StringBuilder 
     Dim sampleText As String = "abcdefghijklmnopqrstuvwxyz123456789" 
     For i As Integer = 1 To sampleText.Length 
      sb.Append(sampleText(i - 1)) 
      If i Mod 25 = 0 Then 
       sb.AppendLine() 
      End If 
     Next 
     Label1.Text = sb.ToString 
    End Sub 
End Class 
相關問題