?? code111a.txt
字號:
Public Sub Find_String(ByVal String1 As String, ByVal String2 As String, ByRef StartPos, ByRef strLength, ByRef Endpos)
Dim I As Integer
strLength = Len(String2)
For I = 1 To (Len(String1) - strLength - 1)
If Mid(String1, I, strLength) = String2 Then
StartPos = I
Endpos = strStart + strLength - 1
Exit Sub
End If
Next
StartPos = 0
End Sub
Public Sub Main()
Dim strStart As Integer, strLength As Integer, Endpos As Integer
StartPos = 0
Endpos = 0
strLength = 0
Debug.Print "Looking for Abc in AbcDef"
Find_String "AbcDef", "Abc", StartPos, Length, Endpos
If StartPos > 0 Then
Debug.Print "Start, Length, End:", StartPos, strLength, Endpos
Else
Debug.Print "Not found."
End If
Debug.Print "Looking for Abc in abcDef"
Find_String "abcDef", "Abc", StartPos, strLength, Endpos
If StartPos > 0 Then
Debug.Print "Start, Length, End:", StartPos, strLength, Endpos
Else
Debug.Print "Not found."
End If
Debug.Print "Looking for Abc in AbcAbc"
Find_String "AbcAbc", "Abc", StartPos, strLength, Endpos
If StartPos > 0 Then
Debug.Print "Start, Length, End:", StartPos, strLength, Endpos
Else
Debug.Print "Not found."
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -