这是我的字符串:
"
Store: Tailor Shop (1)
Send complete welcome package
Datasheet was completed at 01.01.2000"
如何将其转换为
"Store: Tailor Shop (1)
Send complete welcome package
Datasheet was completed at 01.01.2000"
答案 0 :(得分:1)
你可以试试这个,
string.replace(/\n/, '')
没有g
修饰符的正则表达式只会删除第一个换行符。