Dim s As String = "123124" vbTab "213131" vbTab "123123" vbTab "131312"
房山ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為成都創(chuàng)新互聯(lián)公司的ssl證書(shū)銷售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18980820575(備注:SSL證書(shū)合作)期待與您的合作!
Dim arr As String() = s.Split(vbTab) '放入arr數(shù)組
For i As Integer = 0 To UBound(arr)
Console.WriteLine(arr(i))
Next
不需要用數(shù)組:
假設(shè)已經(jīng)存在的圖片文件存放在 C:\圖片 文件夾里,并假設(shè)新創(chuàng)建的文件夾位于C:\圖片 文件夾里。
在窗體上添加一個(gè)按鈕,代碼如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim n As Long = -1
Dim P As Long = -1
Dim Pn As String
Dim MyNum As Integer = 100 '每100個(gè)文件存放在一個(gè)文件夾里
Dim MyPath As String
Dim MyFileName As String
Button1.Enabled = False
MyPath = "C:\圖片\" '指定已有圖片的路徑
MyFileName = UCase(Dir(MyPath, FileAttribute.Normal)) ' 找尋第一項(xiàng)。
Do While MyFileName "" ' 開(kāi)始循環(huán)。
If InStr(MyFileName, "JPG") 0 Or InStr(MyFileName, "GIF") 0 Or InStr(MyFileName, "PNG") 0 Then
n = n + 1
If n \ MyNum P Then
P = P + 1
Pn = CStr(n \ MyNum + 1)
MkDir(MyPath Pn)
End If
FileCopy(MyPath MyFileName, MyPath Pn "\" MyFileName)
End If
MyFileName = UCase(Dir()) ' 查找下一項(xiàng)
Loop
Button1.Enabled = True
End Sub
代碼通過(guò)測(cè)試。
Dim str0 As String, idx As Long, str1 As String, str2 As String
str0 = "122012312}R4561_456}7894321}1234123123}"
idx = str0.IndexOf("}")
Do While idx = 0
str1 = str0.Substring(0, idx)
str2 = str0.Substring(idx + 1)
'在文本框中添加顯示str1、str2,代碼略
str0 = str2
idx = str0.IndexOf("}")
Loop