method str.contains
Whether needle occurs in the text.
Example:
fn main() io {
print("{"hello".contains("ell")} {"hello".contains("z")}")
}Вывод
true false
True when needle occurs in the string.
Example:
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
Параметры
| Имя | Тип |
|---|---|
needle | str |
Возвращает
bool
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/text.oxl:166