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