You can easily produce a version of a string where all the characters are uppercase or all the characters are lowercase.
To produce a string in either uppercase or lowercase form:
Declare a new string variable.
Type = str.ToUpper(); or = str.ToLower() accordingly , where str is a variable holding the original string ( Figure 4.55 ).
Figure 4.55 The ToUpper function creates a new string object from the original where all characters are in uppercase.
string msg= "When are you going to be done?"; string screamMsg = msg.ToUpper(); /* outputs: WHEN ARE YOU GOING TO BE DONE? */
Tip
The ToUpper and ToLower functions don't change the original string. They produce new strings (and therefore new string buffers) with the characters' case modified.