I understand that given a string str
str.replace(/\s/g,'');
will remove all spaces in a string.
How can I remove all characters that are not lower case letters from the string?
I understand that given a string str
str.replace(/\s/g,'');
will remove all spaces in a string.
How can I remove all characters that are not lower case letters from the string?
You could:
str.replace( /[^a-z]/g, '' );