For example, I have the string 11aa32bbb5
and I want to extract only the characters aa
, bbb
or the numbers11, 32, 5
How do I confirm that a letter or string is alphanumeric or not?
This is the implementation I have.
const checkChar = (ch) => {
if (ch.charCodeAt(0) >= 97 && ch.charCodeAt(0) <= 122) {
return true;
};
return false;
};
Thank you!