嗯 - 不确定,但听起来你想要这样的东西?
- Function FndText(strString As String)
- On Error GoTo Err_Control
- Dim Lng As Integer
- ' Searches string for ";" and returns everything to the Right
- ' If no ";" found returns original string
-
- Lng = InStr(strString, ";")
- If Lng > 0 Then
-
- FndText = Right(strString, (Len(strString) - Lng))
- Else
- FndText = strString
- End If
- Exit_Here:
- Exit Function
- Err_Control:
- Select Case Err.number
- 'Add your Case selections here
- Case Else
- MsgBox Err.Description
- Err.Clear
- Resume Exit_Here
- End Select
- End Function
示例用法:
- FndText "\pi-0.875,l0.875;1.HALLO TEST"
返回:
1.HALLO TEST |