Menu
I’m trying to make function to remove a specific character from a string then
returning a new string without that character. for example I wanted to remove all comma in 1,000,000.00. But the returned array is 1,0,0,0,0,0,0,.,0,0. tried using join method but still have no effect.
any help thanks…
function myremovechar(chr,word){
var array1 = word;
var array2 = new Array();
var x,ctr = 0;
var len = array1.length;
while(ctr <= len-1){
if(array1.charAt(ctr)!=’,’){
x = array1.charAt(ctr);
array2.push(x);
}
ctr++;
}
return(array2);
}