string.Split

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

Contents

Description

Splits the string into a table of strings, separated by the second argument.

Arguments

string Inputstring

String to split

Arguments

string Separator

Character(s) to split with.

Returns

table

Split table

Examples

Example

Demonstrates the use of this function.

local mystring = "This is some text"
PrintTable( string.Split( mystring, " " ) )

Output:

1 = This
2 = is
3 = some
4 = text
Personal tools
Navigation