Skip to content

Instantly share code, notes, and snippets.

Created January 9, 2009 17:11
Show Gist options
  • Save anonymous/45182 to your computer and use it in GitHub Desktop.
Save anonymous/45182 to your computer and use it in GitHub Desktop.
#From this
#Method to strip special characters from a string
def strip_specials(data)
if $config["strip_characters"] == 'true'
$config["characters_to_strip"].to_a.each do |char|
data.gsub!(char.chr,"")
end
end
return data
end
#To this!
#Method to strip special characters from a string
def strip_specials(data)
if $config["strip_characters"] == true
$config["characters_to_strip"].to_a.each do |char|
data.gsub!(char.chr,"")
end
end
return data
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment