VB.Net has a compilation option with an instruction / project: Option Compare .
There are two options for this: Text and Binary .
Most likely you configured Text somewhere.
Depending on the settings of your environment, it will be determined how this is set by default. Checking my settings, I usually set it to default in binary format in project settings.
The difference is (from MSDN here ):
Binary:
Results in string comparisons based on sort order derived from internal binary representations of characters. This type of comparison is useful, especially if strings can contain characters that should not be interpreted as text. In this case, you do not want to bias comparisons with alphabetical equivalents, such as case insensitivity.
Text
String matching results based on case insensitive text sorting defined by your language system. This type of comparison is useful if your strings contain all text characters, and you want to compare them based on letter equivalents, such as case insensitivity and closely related letters. For example, you can consider A and a equal, and Γ and Γ€ before B and b.
These options affect not only the obvious equality scenario, but also areas such as sorting sorting.
This can be set / default in the following places:
- The topmost part of the code file
- The project is set by default in the project properties β Compilation page
- By default, for new projects specified in the section βSettings β Projects and Solutions β VB Settings Page.
Personally, I would like to use Binary , as it behaves most similarly to other languages ββsuch as C # / Javascript, etc., and then explicitly encodes where I need case insensitive equality.
Jon egerton
source share