O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Option Compare Statement

Syntax

Option Compare {Binary | Text}

Description

Used to set the default method for comparing string data

Rules at a Glance

  • When Option Compare is not used in a module, the default comparison method is Binary.

  • When Option Compare is used, it must appear at the start of the module’s declarations section, before any procedures.

  • Binary comparison — the default text comparison method in Visual Basic — uses the internal binary code of each character to determine the sort order of the characters. For example, "A" < "a".

  • Text comparison uses the locale settings of the current system to determine the sort order of the characters. Text comparison is case insensitive. For example, "A" = "a".

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required