更新时间:2023-02-26 12:09:26
尝试使用InStr函数,该函数返回找到字符的字符串中的索引.如果InStr返回0,则找不到该字符串.
Try using the InStr function which returns the index in the string at which the character was found. If InStr returns 0, the string was not found.
If InStr(myString, "A") > 0 Then
对于分配给newStr的行上的错误,也将oldStr.IndexOf转换为该InStr函数.
For the error on the line assigning to newStr, convert oldStr.IndexOf to that InStr function also.
Left(oldStr, InStr(oldStr, "A"))