我有一些字符串,例如:
样本输入:
Also known as temple of the city,
xxx as Pune Banglore as kolkata Delhi India,
as Mumbai India or as Bombay India,
Calcutta,India is now know as Kolkata,India,
从上面我想将as xxx xxxx xx转换为as xxx_xxxx_xx,并且应该在最后一个as之后生效。
上面的示例输出:
Also known as temple_of_the_city,
xxx as Pune Banglore as kolkata_Delhi_India,
as Mumbai India or as Bombay_India,
Calcutta,India is now know as Kolkata,India,
在最后一行之后不应有空格分隔的字符串。
如果不清楚,请告诉我。谢谢