ToUpper Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns a copy of this string converted to uppercase.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Function ToUpper As String
public string ToUpper()
public:
String^ ToUpper()
member ToUpper : unit -> string
public function ToUpper() : String
Return Value
Type: System. . :: . .String
The uppercase equivalent of the current string.
Remarks
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.
Note
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.
The ToUpper method is often used to convert a string to uppercase so that it can be used in a case-insensitive comparison. A better method to perform case-insensitive comparison is to call a string comparison method that has a StringComparison parameter whose value you set to StringComparison.CurrentCultureIgnoreCase for a culture-sensitive, case-insensitive comparison.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.