Skip to content

contains

Проверяет, содержит ли строка подстроку.

contains

Сигнатура

typescript
function contains(str: string, substring: string, ignoreCase: boolean = false): boolean

Примеры

typescript
import { contains } from 'strio'

contains('hello world', 'world')
// true

contains('Hello World', 'world', false)
// true

Связанные функции

  • containsAll - Содержит все подстроки
  • containsAny - Содержит любую из подстрок

Смотрите также

Выпущено под лицензией MIT.