method str.endsWith
Whether the text ends with suffix.
Example:
fn main() io {
print("{"hello".endsWith("lo")} {"hello".endsWith("he")}")
}Output
true false
True when the string ends with suffix.
Example:
fn main() io {
print("{"main.oxl".endsWith(".oxl")}")
}Output
true
pub(api) fn endsWith(suffix: str) -> boolComplexity. O(len(suffix)).
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
suffix | str |
Returns
bool
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:216