I was trying to find and replace string by JavaScript but my routine is not working. I guess there is some mistake. Please guide me what to fix in js routine. Here is my script.
function ReplaceChars(srcString)
{
var IgnoreChars = ['<', '>',':', '/', '?', '#', '[', ']', '@', '!', '$', '&', '(', ')', '*', '', '+', ',', ';', '=', ']', ';'];
for (i = 0; i < srcString.length; i++) {
for (j = 0; j < IgnoreChars.length; j++) {
if (srcString.charAt(i) == IgnoreChars.charAt(j))
{
srcString=srcString.replace(srcString.charAt(i), '');
}
}
}
return srcString;
}
var str = '<name>';
alert(ReplaceChars(str));
*and+)