I am trying to create a script that will reduce, for example, "Hello. I had a great day today!" to "helloihadagreatdaytoday". So far I have only managed to convert the text to lower case :^)
I have a string of forbidden characters.
var deletthis = ". !";
var a = deletthis.split("");
As you can see, it bans dot, space and exclamation mark, and turns that string into an array. I then give the user a prompt, and run the return string (q) through a for loop, which should delete the banned characters.
for (i=0; i<a.length; i++) {
q = q.replace(a[i], "");
}
However, this only bans one instance of that character in a string. So if I type "That is nice... Very nice!!!", it would return as "Thatis nice.. Very nice!!".
Any help is appreciated :)!