string-remove-rn

1.0.7 • Public • Published

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"`

Package Sidebar

Install

npm i string-remove-rn

Weekly Downloads

1

Version

1.0.7

License

ISC

Unpacked Size

15.8 kB

Total Files

7

Last publish

Collaborators

  • dearzoe