From: Yui NARUSE Date: 2011-06-03T21:15:24+09:00 Subject: [ruby-core:36716] [Ruby 1.9 - Feature #4822] String#capitalize improvements Issue #4822 has been updated by Yui NARUSE. You should use String#titleize provided by ActiveSupport. http://as.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html#M000381 ---------------------------------------- Feature #4822: String#capitalize improvements http://redmine.ruby-lang.org/issues/4822 Author: Anurag Priyam Status: Open Priority: Normal Assignee: Category: Target version: I think it would be helpful if `String#capitalize` could capitalize _sentences_, and not just the first letter of a string. We could optionally pass a regexp to identify sentence boundaries. If we don't pass this parameter `capitalize` behaves as before. s = "hey all! wassup? i am good." # current capitalize s.capitalize #=> "Hey all! wassup? i am good." # new capitalize s.capitalize #=> "Hey all! wassup? i am good." s.capitalize(/[?!.] /) #=> "Hey all! Wassup? I am good." I am not sure what would it take to implement this. -- http://redmine.ruby-lang.org