📜  js 从字符串中删除美元符号 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:07.109000             🧑  作者: Mango

代码示例1
A common problem with HTML input forms is that users tend to include dollars signs when inputting currency numbers.
These dollars signs can be easily removed through JavaScript by using the JavaScript replace function and a simple regular expression.
This is demonstrated in the following example:

var Amount = '$13.22';
var ReplacedAmount = Amount.replace(/\$/g,'');
document.write(ReplacedAmount);