From Hack Wars Wiki
|Information for free function split()|
|Function||split(string input, string regex)|
|API||Attacking, Banking, FTP, Watch, HTTP, Challenges|
|Description||Returns a stringarray representation of s split into groups divided by the regular expression deliminator.|
string s; s = split("a b c d",char(32)); string j = ""+s;
If you output the variables they will have these values:
j == "[a, b, c, d]"
s == "a"
s == "b"
s == "c"
s == "d"
split() will not work with the divider "." (dot). Two workarounds have been posted in the forum ():
- split(string, "\\\."); This one is based on the odd fact, that split() uses a regular expression here. Will maybe not work anymore, if the bug is corrected.
- split(replaceAll(string, ".", ":"), ":"); This one first replaces the dots with colons and then splits with colon as divider. This will work, even if the bug is corrected (see replaceAll() for more details).