Skip to content

Instantly share code, notes, and snippets.

@jamesgolick
Created March 16, 2010 15:48
Show Gist options
  • Select an option

  • Save jamesgolick/334118 to your computer and use it in GitHub Desktop.

Select an option

Save jamesgolick/334118 to your computer and use it in GitHub Desktop.
def self.clean(string)
if expression = valid_character
stripped = []; for c in string.split(//)
stripped << c if expression.match(c)
end; stripped.join
else
string
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment