OxL Reference

method str.splitOnce

Splits at the first sep: "k=v=w".splitOnce("=") is ("k", "v=w"); none if sep does not occur.

Example:

oxl✓ checked in CI
fn main() io {
  print("{"key=a=b".splitOnce("=")}")
}
Output
("key", "a=b")
pub(api) fn splitOnce(sep: str) -> (str, str)?

Since. 1.0.0-beta

Parameters

NameType
sepstr

Returns

(str, str)?

Effects

none declared (pure unless the body says otherwise)

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

See also