Thursday, February 12, 2009

Visual Basic 2008: How to Change the Case of a String into Title Case?

The code below will change any text (upper case or lower case) to Title Case. Title Case is defined as every first letter of a word in a sentence will be capitalized or will changed to UPPER CASE.

Objects needed
  • Textbox as Textbox1 - this is where the user will input a string.
  • Label as Label1 - this is where the result being displayed.
  • Button as Button1 - if this button will be clicked, it will change the supplied string into a Title-Cased string.
Screen shot


Code

No comments: