Inherits System.Web.UI.Page
Protected Sub btn_cut_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_cut.Click
Dim s As String = ""
Dim str As String = String.Empty
str = txtInputString.Text.Trim()
Dim len As Integer = 0
If txt_length.Text.Equals("") = False Then
len = Int32.Parse(txt_length.Text.Trim())
End If
For i As Integer = 0 To str.Length
Dim r As Integer = i Mod len
Dim last As Integer = (str.Length / len) * len
If i <> 0 And i <= last Then
If r = 0 Then
s += str.Substring(i - len, len) + "<br>"
End If
ElseIf i > last Then
s += str.Substring(i - 1)
Exit For
End If
next
Me.lblMessage.Text = s
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' This tutorial is provided in part by Server Intellect Web Hosting Solutions http://www.serverintellect.com
' Visit http://www.AspNetTutorials.com for more ASP.NET Tutorials
End Sub
End Class