var a = 1,999,999.00 ;
//Replace
var b = a.replace(',' , '');
Output: 1999,999.00
//Replace ALL
while (a.indexOf(',') !== -1)
{
b = a.replace(',' , '');
}
Output: 1999999.00
//Replace ALL + Regex
'Ja va Scri pt'.replace(/\s/g, '')
Output: JavaScript
BACK TO TOP
0 nhận xét:
Post a Comment