OxL Справочник OxL
РусскийEnglish

method str.startsWith

Whether the text begins with prefix.

Example:

oxl✓ проверяется в CI
fn main() io {
  print("{"hello".startsWith("he")} {"hello".startsWith("lo")}")
}
Вывод
true false

True when the string begins with prefix.

Example:

oxl✓ проверяется в CI
fn main() io {
  print("{"oxl.toml".startsWith("oxl")}")
}
Вывод
true
pub(api) fn startsWith(prefix: str) -> bool

Сложность. O(len(prefix)).

С версии. 1.0.0-beta

Параметры

ИмяТип
prefixstr

Возвращает

bool

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/text.oxl:191

См. также