Deleting all special characters from a string – ruby April 21, 2023 by Tarik You can do this a.gsub!(/[^0-9A-Za-z]/, '')