簡體   English   中英

使用 Visual Studio Code 從對象值中刪除尾隨空格

[英]Remove trailing white space from an object value with Visual Studio Code

我有一個對象如下,

var types = {
    '1': 'Trading Status: Active              '
}

如何在我對該對象的價值之后刪除多余的空白?

我試過修剪空白設置。 但它沒有用。 我該怎么做?

 var types = { '1': 'Trading Status: Active ' } // Remove the extra space console.log(types['1'].trim()) // You can check it there is no more space by the length console.log(types['1'].trim().length)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM