string.Left

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

Contents

Description

Returns everything left of supplied place of that string.

Arguments

string str

The string to extract from.

Arguments

number num

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

Returns

string

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

Examples

Example

Extracts "garry" from "garrys mod" string.

local text = "garrys mod"
print(string.Left(text, 5))

Output:


garry
Personal tools
Navigation