Split string

From Kolmafia
Revision as of 19:18, 19 February 2011 by imported>StDoodle (its not it's)
Jump to navigation Jump to search
needs(code_samples);

Function Syntax

string [int] split_string(string source )

string [int] split_string(string source ,string delimiter )

  • source is the string to split
  • delimiter is the (optional) regular expression to split with

Returns an array of your source, split by either delimiter or by line-breaks if not supplied.

Special

This function technically returns an array, not a map. The information in both is accessed in the same way. However, you cannot add new key-value pairs to an array (its length is static once set).