From RPTools WikiJump to navigationJump to search
• 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". By default, numbers and symbols in the strings are treated as word boundaries.
capitalize(input) capitalize(input, treatNumbersSymbolsAsBoundaries)
input- String to be converted.
treatNumbersSymbolsAsBoundaries- Since 1.8. Whether numbers and symbols should be treated as word boundaries - defaults to
Converting character name.
[r: name = getTokenName()]<br> [r: capitalize(name)]
ichabod crane Ichabod Crane
String with numbers and symbols.
[r: capitalize("a 4ever 2/una")]
A 4Ever 2Una
String with numbers and symbols:
[h: vLine = "he's sure i'll see you 1st, o'shea"] [r: capitalize(vLine)] [r: capitalize(vLine, 0)]
He'S Sure I'Ll See You 1St, O'Shea He's Sure I'll See You 1st, O'shea
- 1.5.7 - Added function.
- 1.8 - Added optional param to control treatment of numbers and symbols as word boundaries.