Text::Capitalize provides some routines for title-like formatting of strings.
The simple capitalize function just makes the inital character of each word uppercase, and forces the rest to lowercase.
The capitalize_title function applies English title case rules (discussed below) where only the "important" words are supposed to be capitalized. There are also some customization features provided to allow the user to choose variant rules.
Comparing capitalize and captialize_title:
Input: "lost watches of splitsville" capitalize: "Lost Watches Of Splitsville" capitalize_title: "Lost Watches of Splitsville"
Some examples of formatting with capitalize_title:
Input: "KiLLiNG TiMe" capitalize_title: "Killing Time"
Input: "we have come to wound the autumnal city" capitalize_title: "We Have Come to Wound the Autumnal City"
Input: "ask for whom they ask for" captialize_title: "Ask for Whom They Ask For"
Text::Capitalize also provides some functions for special effects such as scramble_case, which typically would be used for this sort of transformation:
Input: "get whacky" scramble_case: "gET wHaCkY" (or something similar)
Package Version | Update ID | Released | Package Hub Version | Platforms | Subpackages |
---|---|---|---|---|---|
1.5-bp156.3.1 info | GA Release | 2023-07-22 | 15 SP6 |
|
|
1.5-bp155.2.9 info | GA Release | 2023-05-17 | 15 SP5 |
|
|
1.5-bp154.1.18 info | GA Release | 2022-05-09 | 15 SP4 |
|
|
1.3-bp153.1.12 info | GA Release | 2021-03-06 | 15 SP3 |
|
|
1.3-bp152.3.12 info | GA Release | 2020-04-16 | 15 SP2 |
|
|
1.3-bp151.3.1 info | GA Release | 2019-07-18 | 15 SP1 |
|
|
1.3-bp151.2.10 info | GA Release | 2019-05-18 | 15 SP1 |
|
|
1.3-bp150.2.4 info | GA Release | 2018-07-30 | 15 |
|
|