Class: TypedForm::Util
- Inherits:
-
Object
- Object
- TypedForm::Util
- Defined in:
- lib/typed_form/util.rb
Overview
General utility functions used in multiple areas in the gem.
Class Method Summary collapse
-
.normalize_spaces(text) ⇒ Object
Removes non-breaking spaces (character point 160) from TypeForm data before beginning processing.
Class Method Details
.normalize_spaces(text) ⇒ Object
Removes non-breaking spaces (character point 160) from TypeForm data before beginning processing.
6 7 8 |
# File 'lib/typed_form/util.rb', line 6 def self.normalize_spaces(text) text.gsub(/(\\u00a0|\\xC2\\xA0)/, " ").gsub(/[[:space:]]/, " ") end |