The replace first method is *case sensitive*.
php
StringHelper::replaceFirst('abc', '123', 'abc abc abc'); // returns "123 abc abc"
public static replaceFirst ( string $search, string $replace, string $subject ) : mixed | ||
$search | string | Search string to look for. |
$replace | string | Replacement value for the first found occurrence. |
$subject | string | The string you want to look up to replace the first element. |
return | mixed | Replaced string |