From QB64 Wiki
Revision as of 05:15, 3 January 2010 by imported>Clippy
Jump to navigation Jump to search

The RIGHT$ function returns a set number of characters in a STRING variable starting from the end and counting backwards.

Syntax: RIGHT$(stringvalue$, numberofcharacters%)

  • The string value can be any string of ASCII characters as a string variable.
  • If the number of characters exceeds the string length(LEN) the entire string is returned.
  • Number of characters cannot be a negative value.
  • RIGHT$ returns always start at the last character of the string, even if a space. RTRIM$ can remove ending spaces.


name$ = "Tom Williams"

Last$ = RIGHT$(name$, 8)


Screen Returns: Williams

See also: LEFT$, MID$, LTRIM$, RTRIM$,


Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage