lang • right

Right$

Result = Right$ ( String AS String [ , Length AS Integer ] ) Result = Right ( String AS String [ , Length AS Integer ] )

Returns the Length last characters of a string.

If Length is not specified, the last character of the string is returned.

If Length is negative, all the string except the (- Length ) first characters is returned.

Right$ is optimized so that no string duplication occurs to generate the result.

This function only deals with ASCII strings. To manipulate UTF-8 strings, use the String.Right class.

Examples

Print Right$("Gambas", 4)
mbas
Print Right$("Gambas")
s
Print Right$("Gambas", -1)
ambas

See also