Trim   values in javascript

后端 未结 3 1388
情歌与酒
情歌与酒 2021-01-18 06:49

I am trying to trim the text which I get from kendo editor like this.

var html = \"  T  \"; // This sample text I get from Kendo editor
           


        
3条回答
  •  醉酒成梦
    2021-01-18 07:30

    To easiest way to trim non-breaking spaces from a string is

    html.replace(/ /g,' ').trim()
    

提交回复
热议问题