Substr.RightStr Method

function RightStr(const AText: Substring; const ACount: Integer): Substring; overload; inline;

The last ACount characters of AText.

#NameTypeDescription
1ATextSubstring
2ACountInteger

Returns: Substring - The part, as Mid returns it.

Remarks:

An ACount outside 0 .. Length raises ESubstringRangeError.

Examples

The last characters.

uses Substr;

procedure Example;
begin
    Assert(RightStr(Substring('abcdef'), 2) = 'ef');
end;