npm.io
1.0.7 • Published 8 years ago

string-remove-rn

Licence
ISC
Version
1.0.7
Deps
0
Size
15 kB
Vulns
0
Weekly
0
Stars
1

string-remove-rn

去除\r\n 或者 \r 或者 \n。 remove the \r\n or \r or \n.

install

npm install --save string-remove-rn
use
const stringRn = require('string-remove-rn');

let str = `这里是我从数据库拿到的内容,带"\\r\\n"\r\n直接拿到在字符串赋值处理中火报错,所以去除"\\r\\n"`
//参数 string ['rn'(默认)、'r'、'n']
stringRn(str,'rn');

// 输出 =>
`这里是我从数据库拿到的内容,带"\r\n"直接拿到在字符串赋值处理中火报错,所以去除"\r\n"`

Keywords