Skip to main content

RIGHT

Syntax

RIGHT( string, characters )

Description

Returns n-characters starting from the right of the string. String may be a constant or variable string.

String functions may not be nested.

A$ = LEFT("this is a test",5) + RIGHT(B$,3)      ' valid string operation

A$ = RIGHT("this "+b$,5)                                 ' NOT ALLOWED nested operation

Example

text$ = "hello world"

PRINT RIGHT(text$, 5) 'displays "world"

Differences from other BASICs

  • this function does not exist in PBASIC
  • similar function to Visual BASIC

See also