watch 01:25
Jurassic World: Dominion Dominates Fandom Wikis - The Loop
Do you like this video?
Play Sound
This page is intended as a supplement to the official documentation on Delphi programming. CodeGear is in the process of putting the Delphi documentation on the Web. Once they have done so, this page will link to the relevant page in the official documentation.
see the VCL Documentation Guidelines for an overview on doc pages
Unit[]
Description[]
function RightStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload; function RightStr(const AText: WideString; const ACount: Integer): WideString; overload;
The RightStr function takes 2 parameters. The first parameter is the source string and the second is an index integer which counts backwards from the end of the string.
The result is a substring at the very end of the source string with the length given in the second parameter.
Technical Comments[]
(Known issues / Documentation clarifications / Things to be aware of)
Examples[]
uses StrUtils; ... var SourceString, SubString: String; SubStringLength: Integer; begin SourceString := 'Delphi Wikia'; //string length is 12 SubStringLength := 5; SubString := RightStr(SourceString, SubStringLength); ShowMessage(SubString); //will show 'Wikia' SubStringLength := 20; //length is more then the source string SubString := RightStr(SourceString, SubStringLength); ShowMessage(SubString); //will show the complete SourceString 'Delphi Wikia' SubStringLength := -1; SubString := RightStr(SourceString, SubStringLength); ShowMessage(SubString); //If the SubStringLength is anything lower than 1 then then result will be empty end;
See Also[]
(Please provide links to items specifically related to this item.)
User Comments/Tips[]
(Please leave your name with your comment.)