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 つの指定された文字列が同じかどうかを返します。

Equals は、2 つの指定された文字列が同じかどうかを返す関数です。 Equals オーバーロード メソッドは 2 つあります:

  • 1 つ目は、この文字列は、Value パラメータで渡された文字列と同じかどうかを返します。
  • 2 つ目のオーバーロード メソッドは、渡された 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

関連項目