# StringCaseSense

Determines whether string comparisons are case sensitive (default is "not case sensitive").

    StringCaseSense, OnOffLocale

## Parameters

OnOffLocale

  Specify one of the following words:

  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 [v1.0.43.03+]: 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.

  [v1.1.30+]: The decimal values 1 and 0 may be used in place of On and Off, respectively.

## 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().
- IfInString, StringGetPos, and InStr(). However, InStr() is not affected when its CaseSensitive parameter is true.
- StringReplace
- if var in/contains MatchList, if var between, and IfEqual and its family.
- [AHK_L 42+]: if var is [not] type respects the system locale only if the Locale mode is in effect.

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

IfEqual, IfInString, if var between, StringReplace, StringGetPos

## Examples

#1

    StringCaseSense Locale