如何在VB6中提取指定子字符串前的字符

如何在VB6中提取指定子字符串前的字符,vb6,Vb6,我想在指定的子字符串之前提取字符,这是我到目前为止所做的 Dim MyStr As variant, Z as variant, Z1 as variant 'the string to extract character from MyStr="-4<3x-6<12" 'locate the "<" in the string set it as value of Variable Z Z= InstrRev(MyStr, "<") If Z then MsgBo

我想在指定的子字符串之前提取字符,这是我到目前为止所做的

Dim MyStr As variant, Z as variant, Z1 as variant

'the string to extract character from
MyStr="-4<3x-6<12"

'locate the "<" in the string set it as value of Variable Z
Z= InstrRev(MyStr, "<")

If Z then MsgBox "string is" & Mid$
Dim MyStr作为变型,Z作为变型,Z1作为变型
'要从中提取字符的字符串

MyStr=“-4简而言之,InstrRev返回的位置是”
Dim MyStr As String
Dim lngZ As Long ', Z1 As String

'the string to extract character from
MyStr = "-4<3x-6<12"

'locate the "<" in the string set it as value of Variable Z
lngZ = InStrRev(MyStr, "<")

If lngZ > 0 Then
  MsgBox "string is " & Mid$(MyStr, lngZ - 1, 1)
End If