/ Published in: Ruby
Use this to sanitize a string and convert all wierd characters to your choice of delimiter
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#substitute string_name for your variable or a string #substitute "-" for your choice of character #note: doesn't recognize accented characters properly string_name.gsub(/[^a-z0-9]+/i, '-')