Aquablue Posted June 15, 2014 Share Posted June 15, 2014 I'm using CountStr to compare occurrences of a substring in a string, and noticed that it is case sensitive (for example, CountStr(Derp,Derp) gives 1, while CountStr(Derp,derp) gives 0). Is there any way to disable this sensitivity? Quote Link to comment Share on other sites More sharing options...
Wanted Posted June 15, 2014 Share Posted June 15, 2014 I'm using CountStr to compare occurrences of a substring in a string, and noticed that it is case sensitive (for example, CountStr(Derp,Derp) gives 1, while CountStr(Derp,derp) gives 0). Is there any way to disable this sensitivity? Make a modified version of the function that makes every string in both copied to a temp array that runs LowerCase on all of them or just make a new function from scratch that uses LowerCase in the comparison line. Quote Link to comment Share on other sites More sharing options...
FHannes Posted June 15, 2014 Share Posted June 15, 2014 I'm using CountStr to compare occurrences of a substring in a string, and noticed that it is case sensitive (for example, CountStr(Derp,Derp) gives 1, while CountStr(Derp,derp) gives 0). Is there any way to disable this sensitivity? Not that I can remember, but you could as Wanted suggests, simply lowercase both strings, if case is not important. You could also use the PregMatchEx function to match a regular expression without case sensitivity and get the number of results, but that may be a bit overkill in this case. Quote Link to comment Share on other sites More sharing options...