Remove all Non-Alphanumeric Characters from a String (with help from regexp)
·
137 words
·
1 minute read
It’s often useful be be able to remove characters from a string which aren’t relevant, for example when being passed strings which might have $ or £ symbols in, or when parsing content a user has typed in. To do this we use the regexp
package where we compile a regex to clear out anything with isn’t a letter of the alphabet or a number.
|
|