by _mental_ » Sun Oct 29, 2017 12:23 am
Empty tokens are... Surprise! Empty strings. They are not
null’s but strings with zero length.
Updated example:
Code: Select all
String str = "one, two, , four";
Array<String> tokens;
str.Split(tokens, ", "); // tokens contains 4 items: "one", "two", "", "four"
By the way
Split() doesn’t clear array passed to it.
Empty tokens are... Surprise! Empty strings. They are not [b]null[/b]’s but strings with zero length.
Updated example:[code]String str = "one, two, , four";
Array<String> tokens;
str.Split(tokens, ", "); // tokens contains 4 items: "one", "two", "", "four"[/code]
By the way [b]Split()[/b] doesn’t clear array passed to it.