case insensitive InStr

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jdwyer05
    New Member
    • Nov 2006
    • 8

    #1

    case insensitive InStr

    I understand that InStr is case senstive. Is there an alternate function that is case insensitive?
  • albertw
    Contributor
    • Oct 2006
    • 267

    #2
    Originally posted by jdwyer05
    I understand that InStr is case senstive. Is there an alternate function that is case insensitive?
    hi

    no there is not, but you may shortcut this by using UCase() or LCase()

    Comment

    • jdwyer05
      New Member
      • Nov 2006
      • 8

      #3
      Thanks, lcase worked

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by jdwyer05
        Thanks, lcase worked
        Actually, according to the documentation (VB6) you can use Instr and simply tell it not to be case-sensitive. This might be more efficient than converting the text to upper- or lower-case all the time.

        Originally posted by VB documentation
        InStr([start, ]string1, string2[, compare])

        vbBinaryCompare 0 Performs a binary comparison.
        vbTextCompare 1 Performs a textual comparison
        ...
        In English-U.S., binary comparisons are case sensitive; text comparisons are not.

        Comment

        • albertw
          Contributor
          • Oct 2006
          • 267

          #5
          Originally posted by Killer42
          Actually, according to the documentation (VB6) you can use Instr and simply tell it not to be case-sensitive. This might be more efficient than converting the text to upper- or lower-case all the time.
          learned again something today

          Comment

          Working...