handle contractions (e.g. should not capitalize to Don'T but Don't)

This commit is contained in:
Reinhard Pointner 2012-06-29 09:03:23 +00:00
parent 8b887055aa
commit f8b0eaea95
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ String.metaClass.space = { replacement -> replaceAll(/[:?._]/, " ").trim().repla
*
* e.g. "The Day a new Demon was born" -> "The Day A New Demon Was Born"
*/
String.metaClass.upperInitial = { replaceAll(/\b[a-z]/, { it.toUpperCase() }) }
String.metaClass.upperInitial = { replaceAll(/(?<=[&()+.,-;<=>?\[\]_{|}~ ]|^)[a-z]/, { it.toUpperCase() }) }
/**