strsplit("abcd", "cd") returns ["abc";"d"] instead of ["ab";""] (haystack ending exactly with the cutting multichar string)
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
When the haystack ends exactly with a multichar splitting string, strsplit() gets wrong:
--> strsplit("abcdd", "d") // OK: length("d")<2
ans =
"abc"
""
""
--> strsplit("abcdd", "cd") // OK: "cd" does not end "abcdd"
ans =
"ab"
"d"
NOW:
--> strsplit("abcd", "cd") // KO: ["ab";""] expected
ans =
"abc"
"d"
ERROR LOG:
----------
None. Wrong result
HOW TO REPRODUCE THE BUG:
-------------------------
strsplit("abcd", "cd")
OTHER INFORMATION:
------------------
Occurs since Scilab 5.0