RIGHT$/WRIGHT$

Top  Previous  Next

Syntax

STRING = RIGHT$(str as STRING,count as INT)

WSTRING = WRIGHT$(str as WSTRING,count as INT)

Description

Extracts the last (rightmost) characters of a string and returns a copy of the extracted string.

Parameters

str - The string to extract characters from.

count - Leftmost count of characters to extract.

Return value

A copy of the extracted string.

Remarks

Count can be zero in which case an empty string is returned.

See Also: LEFT$, MID$

Example usage

A$ = "A cat and dog"
IF RIGHT$(A$,3) = "dog" THEN PRINT "bow wow"