OxL Reference

method String.freeze

Ends the building and returns the immutable str; the builder is consumed.

Example:

oxl✓ checked in CI
fn main() io {
  var s = String.new()
  s.push("done")
  let text: str = s.freeze()
  print(text)
}
Output
done

Ends the building and returns the immutable str; the builder is consumed.

Example:

oxl✓ checked in CI
fn main() io {
  var s = String.new()
  s.push("done")
  let text = s.freeze()
  print(text)
}
Output
done
pub(api) move fn freeze() -> str

Complexity. O(1); the buffer becomes the `str`.

Since. 1.0.0-beta

Returns

str

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/collections.oxl:1297

See also