Method: String#invalid_chars_to!
- Defined in:
- lib/name_tamer/string.rb
#invalid_chars_to!(separator) ⇒ Object
Change some characters embedded in words to our separator character e.g. example.com -> example-com
30 31 32 |
# File 'lib/name_tamer/string.rb', line 30 def invalid_chars_to!(separator) substitute!(%r{(?<![[:space:]])[\.\/](?![[:space:]])}, separator) end |