RIGHT$()

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

Returns the specified number of characters starting from the right side of a string.
See also LEFT$() and MID$().

Syntax

  1. right$(string, number)

Hints

If number is 0, an empty string ("") is returned.
If number is the length of the string or greater, the full string will be returned.

Example

' Check birthday to qualify

    input "Enter birthday as mm/dd/yyyy: "; b$
    year = val(right$(b$, 4))
    if year < 1970 then
        print "Sorry. Too old."
        print "Perhaps checkers would be nice?"
    else
        print "OK. You're in."
        print "Pick up some equipment and meet us on the field."
    end if

    end

Useful Procedures

' Place a useful function or sub using this keyword here