Hacker News new | past | comments | ask | show | jobs | submit login

Rust's .len() on string does not give you the length in characters, it gives you the length in bytes. If you want the length in unicode codepoints, you need to do .chars().count(), but given things like combining characters, that might not be quite what you want either.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: