From Xojo Documentation

(Redirected from String.Right)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Right (the global function) is here for compatibility with Visual Basic. You should instead use String.Right.

Returns the last n characters from the string specified.



Part Type Description
result String The rightmost count characters of source.
sourceVariable String The source string from which to get the characters.
count Integer The number of characters you wish to get from the source.

If count is greater than the length of source, all characters in source are returned.


The Right function returns characters from the source string starting from the right side (as the name implies).

If you need to read bytes rather than characters, use the MemoryBlock class.


This example uses the Right function to return the last 5 characters from a String:

Var result As String
Var source As String = "Hello World"
result = source.Right(5) // returns "World"

See Also

String for a complete list of functions.