OxL Reference

method str.startsWith

Whether the text begins with prefix.

Example:

oxl✓ checked in CI
fn main() io {
  print("{"hello".startsWith("he")} {"hello".startsWith("lo")}")
}
Output
true false

True when the string begins with prefix.

Example:

oxl✓ checked in CI
fn main() io {
  print("{"oxl.toml".startsWith("oxl")}")
}
Output
true
pub(api) fn startsWith(prefix: str) -> bool

Complexity. O(len(prefix)).

Since. 1.0.0-beta

Parameters

NameType
prefixstr

Returns

bool

Effects

none declared (pure unless the body says otherwise)

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

See also