Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
EnTerr
Level 8

Minor bug: roRegex.split() loses empty strings at the end

What subject says - there is some issue with regex.split(), where it will lose the last few substrings that are empty. fw5 and 3.

Here is example - note each string contains 2 colons and thus should be split in 3 substrings and output should've been all 3s:
BrightScript Debugger> re = createObject("roRegex", ":", "")
BrightScript Debugger> for each line in ["1:2:3", ":2:3", "1::3", "1:2:", "1::", "::"]: ? re.split(line).count(): end for
3
3
3
2
1
0
0 Kudos