Quantcast
Channel: YBBEST SharePoint Pie » SharePoint
Viewing all articles
Browse latest Browse all 20

Javascript Tips and Tricks

$
0
0

1. Replace all , in one Javascript string.

var totalAmount= "100,000,000,000";
var find= ","; //Replace the first , with the empty string
var replace="";
totalAmount= totalAmount.replace(find,replace);
alert(totalAmount);
var totalAmount2= "100,000,000,000";
var newFind=/,/g //Replace all , with empty string
totalAmount2= totalAmount2.replace(newFind,replace);
alert(totalAmount2);


Viewing all articles
Browse latest Browse all 20

Trending Articles