Visual Basic Compiler Options  

/optioncompare:binary

Causes strings to be compared based on their binary representations.

/optioncompare:binary

Remarks

In Microsoft Windows, the code page being used determines the binary sort order. A typical binary sort order is shown in the following example:

A < B < E < Z < a < b < e < z < ? < ? < ? < ? < ? < ?

To set /optioncompare:binary in the Visual Studio integrated development environment

  1. Open the project's Property Pages dialog box. For details, see <Projectname> Property Pages Dialog Box.
  2. Click the Common Properties folder.
  3. Click the Build property page.
  4. Modify the Option Compare property.

To set /optioncompare:binary programmatically

Example

The following code compiles myfile.vb and uses binary string comparisons:

vbc /optioncompare:binary myfile.vb

See Also

Visual Basic Compiler Options | /optioncompare:text | /optionstrict | /optionexplicit | Sample Compilation Command Lines