Slice method πͺβ for the List π¨ class
joeskeen opened this issue Β· comments
Joe Skeen commented
βοΈ Proposed change
Emojicode already has a way to "slice" (substring) a string (πͺβ), but the List class π¨ does not have a similar feature.
π€ Rationale
When writing the regular expression engine, I found it easier to work with lists of graphemes than strings, but I also need to be able to create "substrings" from the array, and didn't want to constantly have to convert it back into a string to do so.
πΊ Example
πͺπΏ0 1 2 3 4 5 6 7 8 9π 2 4β π returns πΏ2 3 4 5π
πͺπΏ0 1 2 3 4 5 6 7 8 9π 10 6β π returns ππ¨ππ’πβ
πͺπΏ0 1 2 3 4 5 6 7 8 9π 7 6β π returns πΏ7 8 9π