System.String.ToUpperInvariant Method

Returns a copy of this string object converted to uppercase using the casing rules of the invariant culture.

Syntax

public string ToUpperInvariant ()

Returns

The uppercase equivalent of the current string.

Remarks

The invariant culture represents a culture that is culture-insensitive. It is associated with the English language but not with a specific country or region. For more information, see Using the InvariantCulture Property.

If your application depends on the case of a string changing in a predictable way that is unaffected by the current culture, use the string.ToUpperInvariant method. The string.ToUpperInvariant method is equivalent to ToUpper(CultureInfo.InvariantCulture). The method is recommended when a collection of strings must appear in a predictable order in a user interface control.

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.

Security Considerations

If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the string.ToLowerInvariant or string.ToUpperInvariant methods.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0