Skip to content

Kirby 3.9.8

Str::position()

Returns the position of a needle in a string if it can be found

Str::position(?string $string, string $needle, bool $caseInsensitive = false): int|bool

Parameters

Name Type Default
$string * string|null
$needle * string
$caseInsensitive bool false

Return type

int|bool

Exceptions

Type Description
Kirby\Exception\InvalidArgumentException for empty $needle

Parent class

Kirby\Toolkit\Str