things i'm missing:
- class 'string' has no member 'split'
this is a temporary splitter
fun string[] split(string arr, string token){
// you trim arr before feeding it to this function
string return_array[0];
string collect;
string ch;
for(0 => int i; i<arr.length(); i++){
arr.substring(i, 1) => ch;
if (ch == token){
return_array << collect.substring(0);
"" => collect;
}
else { ch +=> collect; }
}
return return_array << collect;
}
.substring(int pos)
.substring(int pos , int len)
(1) return new string with characters from pos to end of string
(2) return new string with characters from pos of length len
.replace(int pos, string str)
.replace(int pos, int len, string str)
(1) replace characters of string at pos with str
(2) replace len characters of string with str, starting at pos
.find(int ch)
.find(int ch, int pos)
.find(string str)
.find(string str, int pos)
(1) search for character ch in string, return index of first instance
(2) search for character ch in string, return index of first instance
at or after index pos
(3) search for string str in string, return index of first instance
(4) search for string str in string, return index of first instance at
or after index pos
.rfind(int ch)
.rfind(int ch, int pos)
.rfind(string str)
.rfind(string str, int pos)
(1) search for character ch in string, return index of last instance
(2) search for character ch in string, return index of last instance
at or before index pos
(3) search for string str in string, return index of last instance
(4) search for string str in string, return index of last instance at
or before index pos
.charAt(int index)
return character of string at index
.setCharAt(int index, int ch)
set character of string at index to ch
.insert(int pos, string str)
insert str at pos
.erase(int pos, int len)
remove len characters from string, beginning at pos