Good to see if you can help me I need a function that when writing characters in an input = text checks if prohibited characters are being written that are in a constant, apart from not writing them, it would have to return a true or false depending on whether it is or not typing those characters.
const forbiddenChars = '_`#*¿?=.,;-±ªº®%/$@~{}()[]<>/\\"|';
I currently have this that removes the prohibited characters but I can't check if you can help me.
removeForbidden (searchString) {
const forbiddenChars = '_`#*¿?=.,;-±ªº®%/$@~{}()[]<>/\\"|';
let myval = searchString;
for (var i = 0; i < forbiddenChars.length; i++) {
myval = myval.replace(forbiddenChars[i], '');
};
return myval;
}