JXtension - String.toProperCase()

Purpose:
Gives you the ability to capitalize the first character of each word in a string.
NOTE:  This function only changes the casing of the first character of each word.

Returns:
The string with the first character of each word capitalized.

Example #1:
The code below will capitalize the first letter of each word in the title:

 

Example #2:
The code below will prove that the toProperCase function doesn't change the casing of any letter that isn't the first letter in a word:

 

Take note of the following:

  • The characters that start off capitalized do not get lower cased.
  • The characters that should be capitalized because of their origin (e.g. "x" in JXtension), aren't capitalized.
  • All letters that follow a character which isn't a letter or a digit are capitalized (e.g. "K.U").