System.String.ToUpper Method

Returns a copy of this string converted to uppercase, using the casing rules of the specified culture.

Syntax

public string ToUpper (System.Globalization.CultureInfo culture)

Parameters

culture
An object that supplies culture-specific casing rules.

Returns

The uppercase equivalent of the current string.

Remarks

The casing rules of the culture specified by the culture parameter determine the way the case of a string is changed.

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 pass the string.ToUpper(System.Globalization.CultureInfo) method a System.Globalization.CultureInfo object other than System.Globalization.CultureInfo.InvariantCulture, the casing operation will take culture-specific rules into account. 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 method. This produces the same result in every culture and performs more efficiently.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0