在我的angular 5项目中,我使用的是typescript.trim()函数,但它不会删除空格,也不会给出任何错误.
this.maintabinfo = this.inner_view_data.trim().toLowerCase();
// inner_view_data has this value = "Stone setting"
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-4.html本文档明确说明.trim()
是打字脚本的一部分.
在typescript中,从字符串中删除空格的最佳方法是什么?