StringCaseSense
Determines whether string comparisons are case sensitive (default is "not case sensitive").
StringCaseSense On|Off|Locale
Command Example: StringCaseSense On Function Example: StringCaseSense("On")
Parameters
- On|Off|Locale
On: String comparisons are case sensitive. This setting also makes the expression equal sign operator (=) and the case-insensitive mode of InStr use the locale method described below.
Off (starting default): The letters A-Z are considered identical to their lowercase counterparts. This is the starting default for all scripts due to backward compatibility and performance (Locale is 1 to 8 times slower than Off depending on the nature of the strings being compared).
Locale String comparisons are case insensitive according to the rules of the current user's locale. For example, most English and Western European locales treat not only the letters A-Z as identical to their lowercase counterparts, but also ANSI letters like Ä and Ü as identical to theirs.
Remarks
This setting applies to:
- Expression comparison operators (except ==). However, since the equal-sign operator (=) is always case-insensitive, it uses the Locale mode when StringCaseSense is On, as does the case-insensitive mode of InStr.
- InStr. However, it is not affected when its CaseSensitive parameter is true.
- StrReplace
The built-in variable A_StringCaseSense contains the current setting (the word On, Off, or Locale).
Every newly launched thread (such as a hotkey, custom menu item, or timed subroutine) starts off fresh with the default setting for this command. That default may be changed by using this command in the auto-execute section (top part of the script).
Related
Example
StringCaseSense Locale