Merge: Factorize `capitalize` and add option to preserve uppercase letters
authorJean Privat <jean@pryen.org>
Fri, 3 Jun 2016 01:44:04 +0000 (21:44 -0400)
committerJean Privat <jean@pryen.org>
Fri, 3 Jun 2016 01:44:04 +0000 (21:44 -0400)
Merge the duplicated implementation of `String::capitalized` and `Buffer::capitalize` and extend it to accept the `keep_upper` optional parameter. This parameter triggers keeping uppercase letters as is.

It is applied in nitiwiki to preserve acronyms, like the many apparences of FFI at http://nitlanguage.org/FFI/.

Pull-Request: #2085
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

1  2 
contrib/nitiwiki/src/wiki_base.nit
lib/core/text/abstract_text.nit

Simple merge
Simple merge