System.AnsiStrings.CompareStr

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

function CompareStr(const S1, S2: AnsiString): Integer;
function CompareStr(const S1, S2: AnsiString; LocaleOptions: TLocaleOptions): Integer;

C++

extern DELPHI_PACKAGE int __fastcall CompareStr(const System::AnsiString S1, const System::AnsiString S2)/* overload */;

プロパティ

種類 可視性 ソース ユニット
function public
System.AnsiStrings.pas
System.AnsiStrings.hpp
System.AnsiStrings System.AnsiStrings

説明

2 つの文字列を大文字と小文字を区別して比較します。

CompareStr は、文字列 S1S2 を大文字と小文字を区別して比較します。戻り値は、S1 < S2 の場合は 0 より小さくなり、S1 = S2 の場合は 0、S1 > S2 の場合は 0 より大きくなります。比較操作は、各文字の 8 ビットの序数値に基づいて行われ、現在のユーザーのロケールには影響されません。

大文字と小文字を区別しないで文字列を比較する場合は、CompareText を使用します。

現在のユーザーのロケールで文字列を比較する場合は、AnsiCompareStr を使用します。

関連項目