Skip to content

Kirby 5.3.0

Str::rtrim()

Trims away a fixed sequence at the end of the string. For character list trimming, use PHP's native rtrim() function.

Str::rtrim(string $string, string $trim = ' '): string

Parameters

Name Type Default
$stringrequired string no default value
$trim string ' '

Return type

string

Parent class

Kirby\Toolkit\Str

Examples

Str::rtrim('Cabababa', 'ba'); // 'Ca'