RightCharacters Function

Top  Previous  Next

Returns a specified number of characters from the right side of a string. If length  is less than 1, the empty string is returned. If length  is greater than or equal to the number of characters in string, the entire string is returned.

 

Short form: "right".

 

Syntax

 

value = RightCharacters( inputString, length )

 

Parameters

inputString

 

the string from which to get the characters

length

 

the number of characters to extract




returns

 

the extracted characters

 

Examples

The following examples illustrate the use of the RightCharacters  function:

 

value = RightCharacters( "Hello", 3 )        ' Returns "llo"

value = RightCharacters( "Hello", 2 )        ' Returns "lo"

value = RightCharacters( "Hello", 40 )       ' Returns "Hello"