System.SysUtils.TStringHelper.EndsWith

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

Delphi

function EndsWith(const Value: string): Boolean; overload; inline;
function EndsWith(const Value: string; IgnoreCase: Boolean): Boolean; overload;

プロパティ

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

説明

この 0 基準の文字列が、指定されたサブ文字列で終わっているかどうかを返します。

EndsWith は、この文字列が、Value で渡された文字列で終わっているかどうかを返す関数です。EndsWith は、第2 オーバーロード関数が使用されている場合には、大文字小文字を区別します。IgnoreCase パラメータで、大文字小文字を区別するかを指定します。

 var
   MyString: String;
 
 begin
   MyString := 'This is a string.';
   Writeln(Boolean(MyString.EndsWith('String.', False)));
 end.

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

 FALSE

関連項目