Difference between revisions of "RIGHT$"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
Line 3: Line 3:




''Syntax:'' RIGHT$(stringvalue$, characters%)
''Syntax:'' RIGHT$(stringvalue$, numberofcharacters%)






* The string value can be any string of ASCII characters as a string variable.
* The string value can be any string of ASCII characters as a string variable.
* The number of characters% should not exceed the length([[LEN]]) of the string.
* The number of characters% should not exceed the length([[LEN]]) of the string and cannot be a negative value..
* RIGHT$ return always starts at the last character of the string, even if a space.
* RIGHT$ return always starts at the last character of the string, even if a space. [[RTRIM$]] can remove ending spaces.
* It counts backwards from the end of the string value.
* It counts backwards from the end of the string value.



Revision as of 23:17, 2 January 2010

The RIGHT$ string function returns a part of a STRING value from the end.


Syntax: RIGHT$(stringvalue$, numberofcharacters%)


  • The string value can be any string of ASCII characters as a string variable.
  • The number of characters% should not exceed the length(LEN) of the string and cannot be a negative value..
  • RIGHT$ return always starts at the last character of the string, even if a space. RTRIM$ can remove ending spaces.
  • It counts backwards from the end of the string value.


Example:

name$ = "Tom Williams"

Last$ = RIGHT$(name$, 8)

PRINT Last$


Screen Returns: Williams


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


Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage