In this example
var s = "www.google.com".toSlice();var delim = ".".toSlice();var parts = new string[](s.count(delim) + 1);
parts should contain three elements www / google / com but there are only two dots in www.google.com string.
(count + 1) is required instead of (count) if we want all three parts of the string to be in parts array.
In this example
var s = "www.google.com".toSlice();
var delim = ".".toSlice();
var parts = new string[](s.count(delim) + 1);
parts should contain three elements
www
/google
/com
but there are only two dots inwww.google.com
string. (count + 1) is required instead of (count) if we want all three parts of the string to be inparts
array.