method String.len
The number of bytes built so far.
Example:
fn main() io {
var s = String.new()
s.push("héllo")
print("{s.len()}")
}Output
6
Length in bytes (UTF-8).
Example:
fn main() io {
var s = String.new()
s.push("héllo")
print("{s.len()}")
}Output
6
pub(api) fn len() -> usizeComplexity. O(1).
Since. 1.0.0-beta
Returns
usize
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:1204