string.Right

From Garry's Mod
Jump to: navigation, search
 string.Right( )

Contents

Description

Returns the last n-th characters of the string.

Arguments

string str

The string to extract from.

Arguments

number num

Amount of chars relative to the end (starting from 1).

Returns

string

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

Examples

Example

Extracts "mod" from "garrys mod" string.

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

Output:


mod
Personal tools
Navigation