method
Unicode.len
Unicode.len(s) -> int
Counts the code points in a UTF-8 string — the correct "length" for most text logic, unlike a raw byte count which over-counts anything non-ASCII. Contrast byte_len (storage size) and grapheme_len (user-perceived characters).
Parameters
sthe UTF-8 stringExample
program Len {
entry {
print(Unicode.len("hello")) # 5
}
}