System.SysUtils.TStringHelper.Equals

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

Delphi

function Equals(const Value: string): Boolean; overload;
class function Equals(const a: string; const b: string): Boolean; overload; static;

プロパティ

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

説明

指定された 2 つの 0 基準の文字列が同一かどうかを返します。

Equals は、2 つの 0 基準の文字列が同一かどうかを返す関数です。Equals にはオーバーロード メソッドが 2 つあります。 第 1 メソッドは、この文字列が、Value パラメータで渡された文字列と同じかどうかを返します。第 2 オーバーロード メソッドは static クラス関数で、2 つの渡された文字列間の等価性をチェックするために使用することができます。

 var
   MyString1: String;
   MyString2: String;
 
 begin
   MyString1 := 'This is one string.';
   MyString2 := 'This is another string.';
   Writeln(Boolean(MyString1.Equals(MyString2)));
   Writeln(Boolean(String.Equals(MyString1, MyString2)));
 end.

出力は以下のとおりです。

 FALSE
 FALSE

関連項目