-optioncompare
Specifies how string comparisons are made.
Syntax
-optioncompare:{binary | text}
Remarks
You can specify -optioncompare
in one of two forms: -optioncompare:binary
to use binary string comparisons, and -optioncompare:text
to use text string comparisons. By default, the compiler uses -optioncompare:binary
.
In Microsoft Windows, the current code page determines the binary sort order. A typical binary sort order is as follows:
A < B < E < Z < a < b < e < z < À < Ê < Ø < à < ê < ø
Text-based string comparisons are based on a case-insensitive text sort order determined by your system's locale. A typical text sort order is as follows:
(A = a) < (À = à) < (B=b) < (E=e) < (Ê = ê) < (Z=z) < (Ø = ø)
To set -optioncompare in the Visual Studio IDE
Have a project selected in Solution Explorer. On the Project menu, click Properties.
Click the Compile tab.
Modify the value in the Option Compare box.
To set -optioncompare programmatically
Example
The following code compiles ProjFile.vb
and uses binary string comparisons.
vbc -optioncompare:binary projFile.vb
See also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho