有啊,用正則表達(dá)式,下面是簡單的例子
10余年的甘孜州網(wǎng)站建設(shè)經(jīng)驗(yàn),針對設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。成都營銷網(wǎng)站建設(shè)的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整甘孜州建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。成都創(chuàng)新互聯(lián)從事“甘孜州網(wǎng)站設(shè)計(jì)”,“甘孜州網(wǎng)站推廣”以來,每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
Imports?System.Text.RegularExpressions
Public?Class?Form1
Private?Sub?Button1_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?Button1.Click
Dim?str?As?String?=?"ABCDAEAFAG"
Dim?Patter?As?String?=?"A"
Dim?Matches?As?MatchCollection?=?Regex.Matches(str,?Patter,?RegexOptions.IgnoreCase?Or?RegexOptions.ExplicitCapture)
For?Each?ws?In?Matches
ListBox1.Items.Add("索引位置:"??ws.index)
Next
End?Sub
End?Class
簡單點(diǎn)寫。
Module Program
Sub Main()
Console.WriteLine("Hello World!")
Dim t As String, a() As String, c As Integer
t="/admin/index/login/defasd.php"
a=t.Split("/"c)
c=0
For Each p In a
If c0 Then
Console.WriteLine("/"+p)
End If
c+=1
Next
Console.Write("Press any key to continue . . . ")
Console.ReadKey(True)
End Sub
End Module
========
Hello World!
/admin
/index
/login
/defasd.php
dim st as string = "qwertyuiop"
msgbox(st.indexof("p"))
若為-1,則表示不存在