I think u should use a very simple method to detect string as follows:
The input parameters are
s - String in which character is to detected
c - character to be detected. In your case, it is space " "
// Function to remove the specific char.
function removeChar(s,c)
{
var r="";
for(i=0;i<s.length;i ++)
{
if (s.charAt(i) != c)
r += s.charAt(i);
}
return r;
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.