OxL Reference

method str.slice

Substring of the byte range [a, b); panics unless both are char boundaries.

Example:

oxl✓ checked in CI
fn main() io {
  print("hello".slice(1, 3))
}
Output
el
pub(api) fn slice(a: usize, b: usize) -> str

Since. 1.0.0-beta

Parameters

NameType
ausize
busize

Returns

str

Effects

none declared (pure unless the body says otherwise)

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

See also