lil layzie
Gawd
- Joined
- Jan 7, 2004
- Messages
- 755
In one of my exercises, I have to code an application that allows the user to enter a first and last name. The application should then display the name in a label (last name followed by a comma then space and the first name with the proper case). The first letter of the first and last name should be an uppercase letter and the remaining letters should be lowercase when displayed no matter how the user types the name.
I figured that I would first make the entire first and last name all lowercase then just capitalize the first letter in the first and last name. The problem is how would I make the application understand where to capitalize the first letter in the first and last name?
Here is an part of my code:
I figured that I would first make the entire first and last name all lowercase then just capitalize the first letter in the first and last name. The problem is how would I make the application understand where to capitalize the first letter in the first and last name?
Here is an part of my code:
Code:
firstName = fullName.Substring(0, indexNum)
firstName = firstName.ToLower()
lastName = fullName.Substring(indexNum)
lastName = lastName.ToLower()