String.ToUpper Method ()
Returns a copy of this string converted to uppercase.
Assembly: mscorlib (in mscorlib.dll)
This method uses the casing rules of the current culture to convert each character in the current instance to its uppercase equivalent. If a character does not have an uppercase equivalent, it is included unchanged in the returned string.
This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to uppercase.
Notes to Callers:
As explained in Best Practices for Using Strings in the .NET Framework, we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a string to uppercase by using the casing conventions of the current culture, call the ToUpper(CultureInfo) method overload with a value of CultureInfo.CurrentCulture for its culture parameter.
The following example calls themethod to convert a series of one-character strings that contain each character in the Basic Latin, Latin-1 Supplement, and Latin Extended-A character sets. It then displays each string whose uppercase character is different from its lowercase character.
Available since 4.5
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1