Substring.EndsWithAscii Method

function EndsWithAscii(const Value: string; const IgnoreCase: Boolean): Boolean; overload;

Whether the text ends with Value, ignoring case when IgnoreCase is True for A to Z only: A to Z and a to z match each other, every other character only itself; ordinal when it is False.

#NameTypeDescription
1Valuestring
2IgnoreCaseBoolean

Returns: Boolean

Remarks:

Every text kind.
Note: This routine handles only ANSI/ASCII case char mapping and does not handle locale specific char handling, but it is 9.8 to 149 times faster than its EndsWithLinguistic alternative.

Examples

A suffix in another case.

uses Substr;

procedure Example;
begin
    Assert(Substring('Hello').EndsWithAscii('LO', True));
    Assert(not Substring('Hello').EndsWithAscii('LO', False));
end;