且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从字符串中删除所有逗号并添加空格?

更新时间:2023-12-03 19:56:16

不需要split()方法,因为您没有尝试将字符串转换为数组。

The split() method is not needed since you are not trying to turn the string into an array.

只需直接删除所有逗号:

Just to remove all commas straighforwardly:

a.replace(',', '');
b.replace(',', '');