Remove all Non-alphanumeric in a String via Regular Expression
Remove all Non-alphanumeric in a String via Regular Expression
I had a need to remove all special characters in a string.
Regular expressions saved the day:
validation_string = string1.replaceAll("\W|_","",false);
Ref:
http://stackoverflow.com/questions/3114027/regex-expressions-for-all-non-alphanumeric-symbols
Cheers,
John Whitney