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