System.SysUtils.TStringHelper.EndsWith

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

Properties

Type Visibility Source Unit Parent
function public System.SysUtils.pas System.SysUtils TStringHelper

Description

Returns whether this 0-based string ends with the given substring.

EndsWith is a a function that returns whether this string ends with the string passed through Value. EndsWith is case-sensitive if the second overloaded function is used. The IgnoreCase parameter specifies whether to use case-sensitivity or not.

var
  MyString: String;

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

Output:

FALSE

See Also