晕,整这么复杂,用pos即可实现,它后面可以第三个参数
Description
Finds one string within another string.
Syntax
Pos ( string1, string2 {, start } )
Argument Description
string1 The string in which you want to find string2.
string2 The string you want to find in string1.
start
(optional) A long indicating where the search will begin in string1. The default is 1.
Return value
Long. Returns a long whose value is the starting position of the first occurrence of string2 in string1 after the position specified in start. If string2 is not found in string1 or if start is not within string1, Pos returns 0. If any argument's value is null, Pos returns null.
Usage
The Pos function is case sensitive.