【文件属性】:
文件名称:string-remove-rn:【NPM】处理带\r\n的字符串 remove string \r\n
文件大小:2KB
文件格式:ZIP
更新时间:2021-05-02 06:43:10
JavaScript
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"`
【文件预览】:
string-remove-rn-master
----README.md(874B)
----index.js(568B)
----package.json(429B)