Package Info

perl-Text-Capitalize


Capitalize strings ("to WORK AS titles" becomes "To Work as Titles")


Development/Libraries/Perl

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)


License: Artistic-1.0 OR GPL-1.0-or-later
URL: https://metacpan.org/release/Text-Capitalize

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
1.5-bp156.3.1 info GA Release 2023-07-22 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Text-Capitalize
1.5-bp155.2.9 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Text-Capitalize
1.5-bp154.1.18 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Text-Capitalize
1.3-bp153.1.12 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Text-Capitalize
1.3-bp152.3.12 info GA Release 2020-04-16 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Text-Capitalize
1.3-bp151.3.1 info GA Release 2019-07-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Text-Capitalize
1.3-bp151.2.10 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Text-Capitalize
1.3-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Text-Capitalize