I tried to cut dot from string using the following function:
function removeSymbols(str){
console.log(str.length);
str.replace(/\./g, "");
return str;
}
var str = " народу.";
But it does not cut
I tried to cut dot from string using the following function:
function removeSymbols(str){
console.log(str.length);
str.replace(/\./g, "");
return str;
}
var str = " народу.";
But it does not cut
function removeSymbols(str) {
console.log(str.length);
str = str.replace(/\./g, "");
return str;
}
var str = " народу.";
console.log(removeSymbols(str));
replace
doesn't change the original string, it will return a new string that is replaced.