Skip to content

Slice does not work with multi-byte characters #3

@Ants-Aare

Description

@Ants-Aare

the slice method is used a lot to remove the first character for example. but the number you pass into slice(1) doesn't say "slice one character" but "slice one byte" there are lots of characters with codepoints ranging over multiple bytes. so maybe do mystring.slice(mystring.codepoints.at(0).len()) which could be expensive over time, but I'm not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions