Module: OpencBot::Helpers::Text
Instance Method Summary collapse
Instance Method Details
#normalise_utf8_spaces(raw_text) ⇒ Object
7 8 9 |
# File 'lib/openc_bot/helpers/text.rb', line 7 def normalise_utf8_spaces(raw_text) raw_text&&raw_text.gsub(/\xC2\xA0/, ' ') end |
#strip_all_spaces(text) ⇒ Object
11 12 13 |
# File 'lib/openc_bot/helpers/text.rb', line 11 def strip_all_spaces(text) text&&normalise_utf8_spaces(text).strip.gsub(/\s+/,' ') end |