Custom Function which can split strings and runs callback for each string. It can run even with no delimiter present (with single element). Example usage: “H001,H002”.forEachIn(“,”) -> doSomething()
public interface ForStringSplitCallback
Members:
callback(string str)public tuple char(int c)
public function createCenteredTexttag(vec3 pos, string message, real size) returns texttag
public function char(string s) returns char
public function charToIndex(char c) returns int
public function charFromIndex(int index) returns char
public function texttag.center(vec3 pos, string message, real size) returns texttag
public function string.getWidth() returns int
Returns the width of the string
public function char.toString() returns string
public function char.toInt() returns int
public function char.getWidth() returns int
public function string.toChar() returns char
public function string.toCharList() returns LinkedList<char>
public function int.toChar() returns char
public function string.split(string splitBy) returns LinkedList<string>
Splits the string by another string “this..is..an..example” split by the string “..” splits into a list containing four strings [“this”, “is”, “an”, “example”]
public function string.reduce(string reduced) returns string
Replaces consecutive repeats of the same string with a single instance Turns “strstr” into “str”
public function string.reduce() returns string
Replaces consecutive repeats of the whitespace character with a single instance Turns “ “ into “ “
public function string.forEachIn(string delim, ForStringSplitCallback cb)
public function string.isNumber() returns bool
Checks whether a string is a number or not.
public function string.isValidDescription() returns bool
Checks whether a string is valid in terms of max WC3 string length for various usages (Ability Description, Quest Description,…).
public function string.replaceChars(string charset, string replacementChar) returns string
Replaces all occurences of any character from given charlist by a given replacement string.