Method: Cinch::Formatting.unformat
- Defined in:
- lib/cinch/formatting.rb
.unformat(string) ⇒ String
Deletes all mIRC formatting codes from the string. This strips formatting for bold, underline and so on, as well as color codes. This does include removing the numeric arguments.
121 122 123 |
# File 'lib/cinch/formatting.rb', line 121 def self.unformat(string) string.gsub(/[\x02\x0f\x16\x1f\x12]|\x03(\d{1,2}(,\d{1,2})?)?/, '') end |