阅读(2498)
赞(3)
Laravel 8 replaceFirst {#collection-method}
2021-07-05 09:43:52 更新
replaceFirst
方法用于替换字符串中指定值的第一个匹配项:
use IlluminateSupportStr;
$replaced = Str::of('the quick brown fox jumps over the lazy dog')->replaceFirst('the', 'a');
// a quick brown fox jumps over the lazy dog