Garry's Mod Wiki

Revision Difference

string.Split#511940

<function name="Split" parent="string" type="libraryfunc">⤶ <description>Splits the string into a table of strings, separated by the second argument.</description>⤶ <realm>Shared and Menu</realm>⤶ <args>⤶ <arg name="Inputstring" type="string">String to split</arg>⤶ <arg name="Separator" type="string">Character(s) to split with.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="table">Split table</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Demonstrates the use of this function.</description>⤶ <code>⤶ local mystring = "This is some text"⤶ PrintTable( string.Split( mystring, " " ) )⤶ </code>⤶ <outputfixedwidth>Fixed width</outputfixedwidth>⤶ <output>⤶ 1 = This⤶ 2 = is⤶ 3 = some⤶ 4 = text⤶ </output>⤶ ⤶ </example>