June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to capitalize or de-capitalize all letters in a string.
Use the ToUpper or ToLower method of the String class.
ToUpper method returns a new string that is all uppercase. The ToLower method returns a new string that is all lowercase.
Dim MixedCase, UpperCase, LowerCase As String MixedCase = "hELLo" UpperCase = MixedCase.ToUpper() ' UpperCase is now "HELLO" LowerCase = MixedCase.ToLower() ' LowerCase is now "hello"
If you want to operate on only part of a string, split the string as described in recipe Retrieve a Portion of a String, call ToUpper or ToLower on the appropriate substring, and then join the strings back together.
Read now
Unlock full access