Remove first occurrence of comma in a string

后端 未结 5 1450
甜味超标
甜味超标 2020-12-18 20:51

I am looking for a way to remove the first occurrence of a comma in a string, for example

\"some text1, some tex2, some text3\"

should retu

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 21:47

    you could also use a lookahead like so ^(.*?),(?=.*,) and replace w/ $1
    Demo

提交回复
热议问题