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