我需要将记事本++中的多行加入一行,以逗号作为分隔符
one
two
three
four
five
Run Code Online (Sandbox Code Playgroud)
我需要的输出如下
one,two,three,four,five
Run Code Online (Sandbox Code Playgroud)
Ctrl+A和Ctrl+j将加入但会增加空间
\R(?=\S)
,
解释:
\R : any kind of linebreak
(?=\S) : Positive lookahead, make sure we have a non space character after, to avoid inserting a comma at the end of the string
Run Code Online (Sandbox Code Playgroud)
给定示例的结果:
one,two,three,four,five
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3882 次 |
最近记录: |