Skip to content

Kirby 3.8.4

Str::increment()

Adds -1 to a string or increments the ending number to allow -2, -3, etc.

Str::increment(string $string, string $separator = '-', int $first = 1): string

Parameters

Name Type Default Description
$string * string The string to increment
$separator string '-'
$first int 1 Starting number

Return type

string

Parent class

Kirby\Toolkit\Str