如何删除字符串中的空格?例如:
输入:
'/var/www/site/Brand new document.docx'输出:
'/var/www/site/Brandnewdocument.docx'发布于 2022-06-07 14:06:10
您可以使用regex从字符串中删除空格。
let str = '/var/www/site/Brand new document.docx';
let result = str.replace(/\s/g, '');https://stackoverflow.com/questions/5963182
复制相似问题