Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For what it's worth, Rust's string length tells you the number of conventional characters, whilst following typical programming notation rules.


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: