例如 “ ?”   是  ?,.,:,'  中的一个 ,手边没有书

解决方案 »

  1.   

    就是把  if x="str1" or x="str2" or x="str3" or x="str4" or x="str5" or x="str6" then写简单点,好像有个 instring 的
      

  2.   

    没有好的函数,难道
    暂时用下面的解决了
    select case xcase "str1","str2","str3","str4","str5","str6"'...end select
      

  3.   

    if instr("?,.,:,'","?")>0 
      

  4.   

    InString()函数只是检测包含与否,如果像上面确切的"str1"不建议这么用,"strABCD"也包含num= Mid(x,3);'Right(x,1)也行 严谨起见,最好再做长度为4判断
    If IsNumeric(num) then
        If Left(x,3)="str" '视情况添加 And num>=1 And num<=6
            '...
    End If
      

  5.   


    实际上有许多方法,例如使用 Like 操作符:If x Like "str[2-6]" then
      

  6.   

    本帖最后由 bcrun 于 2011-10-20 13:27:51 编辑
      

  7.   

    简单匹配,使用instr或instrrev函数
    复杂匹配使用Like语句
      

  8.   

    本帖最后由 bcrun 于 2011-10-20 13:28:43 编辑
      

  9.   

    用INSTR()函数,判断是否大于0