Posted on 2012-03-18
Create a script that takes text that a user enters into a form and converts it to the title case capitalization. To accomplish this, use the Split() method to split the words in the string into an indexed array. Then, create a for loop that uses another split() method that splits each word in the elements of the indexed array into another indexed array of characters. Within the for loop, use the ToUpper() method to convert the first element in the second array (which represents the first character in the word to uppercase) to uppercase, and then use the Join() method to rebuild the array of words in the text string. Execute a final Join() method to convert the array of words back into a single text string. Save the project as TitleCase.