How do I trim() a string in angularjs?

后端 未结 5 1957
误落风尘
误落风尘 2021-02-05 08:51

Is there an angular specific way? If not, should I use the built in jquery to do it? If I should use the built in jquery how do I get to the trim() function without using $ (o

5条回答
  •  猫巷女王i
    2021-02-05 09:16

    use trim() method of javascript after all angularjs is also a javascript framework and it is not necessary to put $ to apply trim()

    for example

    var x="hello world";
    x=x.trim()
    

提交回复
热议问题