help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'sysutils' (#rtl)

RightStr

Return a number of characters from a string, starting at the end.

Declaration

Source position: sysstrh.inc line 247

function RightStr(

  const S: String;

  Count: Integer

):String;

Description

RightStr returns the Count rightmost characters of S. It is equivalent to a call to Copy(S,Length(S)+1-Count,Count).

If Count is larger than the actual length of S only the real length will be used.

Errors

None.

See also

LeftStr

  

Return a number of characters starting at the left of a string.

Trim

  

Trim whitespace from the ends of a string.

TrimLeft

  

Trim whitespace from the beginning of a string.

TrimRight

  

Trim whitespace from the end of a string.

Example

Program Example79;

{ This program demonstrates the RightStr function }

Uses sysutils;

Begin
  Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',20));
  Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',15));
  Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',1));
  Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',200));
End.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505