摘要:String.Split字串分割(語法VB.NET)
開一個新的網頁命名為
WebForm2
Public Class WebForm2
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim str1 As String = "這|||||是|||||字|||||串|||||分|||||割|||||範|||||例"
Dim str2 As String()
str1 = str1.Replace("|||||", "|")
str2 = str1.Split("|")
For Each i As String In str2
Response.Write(i.ToString())
Next
End Sub
End Class
完成結果