Laravel 8 replaceFirst {#collection-method}
2021-07-19 10:34 更新
replaceFirst
方法用于替换字符串中指定值的第一个匹配项:
use Illuminate\Support\Str;
$replaced = Str::of('the quick brown fox jumps over the lazy dog')->replaceFirst('the', 'a');
// a quick brown fox jumps over the lazy dog
以上内容是否对您有帮助:
更多建议: