capitalize: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "{{MacroFunction |name=capitalize |proposed=true |trusted=false |version=1.5.7 |description= Returns the passed string back with the first letter of each word capitalized. This...")
 
No edit summary
Line 36: Line 36:


|also=
|also=
[[linkToRelatedArticle|Display Name of Related Article]]
{{func|upper}} {{func|lower}}


|changes=
|changes=

Revision as of 18:04, 25 October 2019

 Note: This refers to a proposed change that has not been implemented in the main code base yet.

capitalize() Function

Introduced in version 1.5.7
Returns the passed string back with the first letter of each word capitalized. This means that "bump player health" becomes "Bump Player Health". Numbers and symbols in the strings are treated as word boundaries.

Usage

capitalize(input)

Parameters

  • input - String to be converted.

Example

Converting character name.
[r: name = getTokenName()]<br>
[r: capitalize(name)]

Returns:

ichabod crane
Ichabod Crane

String with numbers and symbols.

[r: capitalize("a 4ever 2/una")]

Returns:

A 4Ever 2Una

See Also

Version Changes

  • 1.5.7 - Added function.