method str.startsWith
Whether the text begins with prefix.
Example:
fn main() io {
print("{"hello".startsWith("he")} {"hello".startsWith("lo")}")
}Вывод
true false
True when the string begins with prefix.
Example:
fn main() io {
print("{"oxl.toml".startsWith("oxl")}")
}Вывод
true
pub(api) fn startsWith(prefix: str) -> boolСложность. O(len(prefix)).
С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
prefix | str |
Возвращает
bool
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/text.oxl:191