By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,594 Members | 2,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,594 IT Pros & Developers. It's quick & easy.

case insensitive InStr

P: 8
I understand that InStr is case senstive. Is there an alternate function that is case insensitive?
Nov 21 '06 #1
Share this Question
Share on Google+
4 Replies


100+
P: 267
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()
Nov 21 '06 #2

P: 8
Thanks, lcase worked
Nov 21 '06 #3

Expert 5K+
P: 8,434
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.

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.
Nov 21 '06 #4

100+
P: 267
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
Nov 21 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.