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