-
Couldn't load subscription status.
- Fork 0
ProtoString toTitleCase() Method
Seth Clydesdale edited this page May 28, 2015
·
4 revisions
<< Back to Case Manipulation Methods
Converting movie and book names into title case.
'the wizard of oz'.toTitleCase(); // returns 'The Wizard of Oz'
'war of the worlds'.toTitleCase(); // returns 'War of the Worlds'Using the ignore parameter to change the casing method to Start Case.
'the wizard of oz'.toTitleCase(true); // returns 'The Wizard Of Oz'
'war of the worlds'.toTitleCase(true); // returns 'War Of The Worlds'Using this method on a string will capitalize the first letter of each word, except for certain subsets. Passing true or 1 as the parameter will ignore this rule, therefore capitalizing all words regardless of function. It can be used to titleize a string of text for use as a heading, title, etc..
String.toTitleCase(ignore);| Parameter | Description |
|---|---|
| ignore | A boolean value specifying that you want to ignore articles, conjunctions, and prepositions, by changing the casing method to Start Case. Setting this to true would return "War of the Worlds" as "War Of The Worlds" |
Home • History • ProtoString • Created by Seth Clydesdale