Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/wikipedia.rb
Instance Method Summary collapse
Instance Method Details
#capitalize_every_word ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/wikipedia.rb', line 13 def capitalize_every_word() new_string = [] self.split(' ').each do |word| new_string << word.capitalize end return new_string.join(' ') end |
#capitalize_every_word! ⇒ Object
20 21 22 |
# File 'lib/wikipedia.rb', line 20 def capitalize_every_word!() self.replace( self.capitalize_every_word() ) end |