C# String ToUpper()

Description

String ToUpper() returns a copy of this string converted to uppercase.

Syntax

String.ToUpper() has the following syntax.


public string ToUpper()

Returns

String.ToUpper() method returns The uppercase equivalent of the current string.

Example

The following example calls the ToUpper method.


using System;/*  w w w . j av a  2  s  . c  om*/

public class Example
{
   public static void Main()
   {
       string string1 = "asdf".ToUpper();
       Console.WriteLine(string1);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version