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

method str.contains

Whether needle occurs in the text.

Example:

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

True when needle occurs in the string.

Example:

oxl✓ проверяется в CI
fn main() io {
  print("{"hello".contains("ell")} {"hello".contains("z")}")
}
Вывод
true false
pub(api) fn contains(needle: str) -> bool

Сложность. O(n * m) worst case in the lengths of text and needle.

С версии. 1.0.0-beta

Параметры

ИмяТип
needlestr

Возвращает

bool

Эффекты

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

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

См. также