Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/string_extensions.rb
Overview
String Extensions
- Author
-
Joel Parker Henderson, [email protected]
- Copyright
-
Copyright © 2006-2008 Joel Parker Henderson
- License
-
CreativeCommons License, Non-commercial Share Alike
- License
-
LGPL, GNU Lesser General Public License
Ruby String base class extensions
Instance Method Summary collapse
Instance Method Details
#capitalize_words ⇒ Object
22 23 24 |
# File 'lib/string_extensions.rb', line 22 def capitalize_words split(/\b/).map{|x| x.capitalize }.join end |
#split_tab ⇒ Object
18 19 20 |
# File 'lib/string_extensions.rb', line 18 def split_tab split(/\t/) end |
#words ⇒ Object
14 15 16 |
# File 'lib/string_extensions.rb', line 14 def words split(/\W*\b\W*/) end |