emojicode / emojicode

πŸ˜€πŸ˜œπŸ”‚ World’s only programming language that’s bursting with emojis

Home Page:https://emojicode.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slice method πŸ”ͺ❗ for the List 🍨 class

joeskeen opened this issue Β· comments

⭐️ 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πŸ†