Actions
Feature #4822
closedString#capitalize improvements
Feature #4822:
String#capitalize improvements
Status:
Rejected
Assignee:
-
Target version:
-
Description
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.
Actions