本文介绍了trim()和“& nbsp;”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好, 我使用以下修剪功能: 功能修剪(str){ 返回str.replace(/ ^ \ s * / g,'''').replace(/ \ * * $ / g,''''); } 问题是这并没有削减& nbsp;的实例。 char - 不间断的空间。这可以用 的grep声明表示吗? Rob :)Hi All,I am using the following trim function:function trim (str) {return str.replace(/^\s*/g, '''').replace(/\s*$/g, '''');}The problem is that this doesn''t trim instances of the " " char -the non breaking space. Can this be represented in a grep statement atall?Rob:)推荐答案 这篇关于trim()和“& nbsp;”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-27 06:37
查看更多