Garry's Mod Wiki

string.Right

  string string.Right( string str, number num )

Description

Returns the last n-th characters of the string.

Arguments

1 string str
The string to extract from.
2 number num
Amount of chars relative to the end (starting from 1).

Returns

1 string
Returns a string containing a specified number of characters from the right side of a string.

Example

Extracts "mod" from "garrys mod" string.

local text = "garrys mod" print( string.Right( text, 3 ) )
Output: mod