OxL Reference

method str.trim

The text without leading and trailing whitespace.

Example:

oxl✓ checked in CI
fn main() io {
  print("[{"  padded \n".trim()}]")
}
Output
[padded]

Removes whitespace at both ends.

Example:

oxl✓ checked in CI
fn main() io {
  print("[{"  hi \n".trim()}]")
}
Output
[hi]
pub(api) fn trim() -> str

Complexity. O(n).

Since. 1.0.0-beta

Returns

str

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/text.oxl:403

See also