html52.com
我爱小程序-开发者交流社区

如何去掉字符中的回车行?

   word-break: keep-all;      word-break: keep-all;

  word-wrap: break-word;

  white-space: pre-line;

  text-overflow:ellipsis;

这个方法也用了 ,还用了

<wxs module="util">

var format = function(text){

if(!text){

return

}

var reg = getRegExp('\\\\n','g');

    reg = getRegExp('\\\\n','g');

var text = text.replace(reg,'\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');

    text = text.replace("/\n/g",'\\n');


return text;

}

module.exports = {

format:format

}

</wxs>

<wxs module="m2">

     var ReplaceHuanghang =function(strCp)

  return strCp.replace("/↵/g","")  ;  

}

module.exports.ReplaceHuanghang = ReplaceHuanghang;

</wxs>

还是无济于事,那个回车是excel复制带过来的

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付