Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/wcc.rb
Instance Method Summary collapse
-
#strip_html ⇒ String
Remove all HTML tags with at least one character name and decode all HTML entities into utf-8 characters.
-
#substring(i) ⇒ String
Returns all characters from the i-th to the end.
Instance Method Details
#strip_html ⇒ String
Remove all HTML tags with at least one character name and decode all HTML entities into utf-8 characters.
36 37 38 |
# File 'lib/wcc.rb', line 36 def strip_html HTMLEntities.new.decode(self.gsub(/<[^>]+>/, ' ')) end |
#substring(i) ⇒ String
Returns all characters from the i-th to the end.
44 45 46 |
# File 'lib/wcc.rb', line 44 def substring(i) slice(i...length) end |