parse.bas
来自「常用基本函数库,也许你需要的正在其中!如果不做程序」· BAS 代码 · 共 27 行
BAS
27 行
Option Explicit
Function Parse$ (ByVal sString As String, iReq As Integer, sDelim As String)
Dim sSt As String, iCnt As Integer, iPos As Integer
If Len(sDelim) = 0 Then sDelim = ","
sSt = sString & sDelim
For iCnt = 1 To iReq
iPos = InStr(sSt, sDelim)
If iPos Then
If iCnt = iReq Then ' Requested string
Parse$ = Left$(sSt, iPos - 1)
Exit For
End If
If iPos = Len(sSt) Then ' No string left
Parse$ = ""
Exit For
End If
sSt = Mid$(sSt, iPos + Len(sDelim))
Else
Parse$ = sSt
Exit For
End If
Next iCnt
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?