| RightStr Function | 
Unit
QESBPCSConvert
Declaration
Function RightStr(const S: string; const N: LongWord): string;
Description
Also See: LeftStr, RightAfterStr
| Parameters | 
| S | the String from which the right substring is to be taken. | 
| N | the length of the resultant substring. If Length (S) < N then S is returned. | 
Category
Extra String Handling RoutinesImplementation
 
| function RightStr (const S: string; const N: LongWord): string;
var
     M: LongWord;
begin
     M := Int64 (Length (S)) - N + 1; // Calculate the starting point
     if M < 1 then // If longer then string, return string
          M := 1;
     Result := Copy (S, M, N); // Return last N characters
End; | 
|  |