我要做两个字符串的比较, 要判断其中一个字符串是否是另一个字符串[]里的内容,不是包含关系,是必须相等如[vbprogram]is good   和 vbprogram ,要判断后者是否是前者[]之间的全部内容

解决方案 »

  1.   

    dim i,j as interge
    i=instr(1,"[vbprogram]is good","[")
    j=instr(1,"[vbprogram]is good","]")
    if mid("[vbprogram]is good",i+1,j-i-1)="vbprogram" then
      msgbox "yes"
    else
      msgbox "no"
    endif
      

  2.   

    Private Sub Command1_Click()
    MsgBox iseaque("[vbprogram]is good", "vbprogram")
    End Sub
    Function iseaque(ByVal a As String, ByVal b As String) As Boolean
    b = "[" & b & "]"
    iseaque = InStr(a, b) > 0
    End Function