OxL Reference

method String.len

The number of bytes built so far.

Example:

oxl✓ checked in CI
fn main() io {
  var s = String.new()
  s.push("héllo")
  print("{s.len()}")
}
Output
6

Length in bytes (UTF-8).

Example:

oxl✓ checked in CI
fn main() io {
  var s = String.new()
  s.push("héllo")
  print("{s.len()}")
}
Output
6
pub(api) fn len() -> usize

Complexity. 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

See also