Garry's Mod Wiki

string.Split

string.Split

  table string.Split( string Inputstring, string Separator )

Description

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

This is an alias of string.Explode.

Arguments

1 string Inputstring
String to split
2 string Separator
Character(s) to split with.

Returns

1 table
Split table

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

Special Pages


Wikis

?

Render Time: 43ms

DB GetPage 23
Generate Html 4
SaveChanges (1) 6
Render Body 0
Render Sidebar 7