Y
Hacker News
new
|
ask
|
show
|
jobs
by
paulddraper
2386 days ago
It's a bit of both. Rust strings are (guaranteed valid) UTF-8 bytes.
str.len() returns the number of bytes; s.chars().count() returns the number of characters.