OxL Reference

method str.endsWith

Whether the text ends with suffix.

Example:

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

True when the string ends with suffix.

Example:

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

Complexity. O(len(suffix)).

Since. 1.0.0-beta

Parameters

NameType
suffixstr

Returns

bool

Effects

none declared (pure unless the body says otherwise)

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

See also