In C#, Char.ToUpper returns the uppercase form of a character using culture casing rules.
Like ToLower, culture can surprise you. Prefer ToUpperInvariant or ToUpperOrdinal (.NET 7+) for stable results.
This is a static member of System.Char. You call it with the type name, such as Char.ToUpper(...) or char.ToUpper(...). A char holds one 16-bit UTF-16 code unit.
Syntax
Pass a char; optionally pass a CultureInfo.
C#
char up = Char.ToUpper('a');
Call
What it does
Char.ToUpper(c)
Uppercase using current culture.
Char.ToUpper(c, culture)
Uppercase using a specific culture.
Non-letters usually return unchanged.
Library declarations
C#
public static char ToUpper(char c);
public static char ToUpper(char c, CultureInfo culture);
Parameters
Parameter
Description
c
Character to convert.
culture
Optional culture for casing rules.
Return Value
Return Value
Description
char
Uppercase character (or unchanged).
C# Examples
Example 1 — a to A
Uppercase a Latin letter.
C#
using System;
class Program {
static void Main() {
char up = Char.ToUpper('a');
Console.WriteLine(up);
Console.WriteLine(Char.IsUpper(up));
}
}
Output
A
True
How It Works
Start lower. Character a.
ToUpper. Becomes A.
IsUpper true. Confirms case.
Culture default. Uses current culture.
Example 2 — Capitalize First Letter
Uppercase only the first character of a word.
C#
using System;
class Program {
static void Main() {
string word = "ada";
char first = Char.ToUpper(word[0]);
string titled = first + word.Substring(1);
Console.WriteLine(titled);
}
}
Output
Ada
How It Works
First char. Take index 0.
Upper it. ToUpper on that char.
Rebuild. Join with the remainder.
Ada result. Simple title pattern.
Example 3 — Invariant Alternative
Prefer invariant for stable uppercase.
C#
using System;
class Program {
static void Main() {
char c = 'i';
Console.WriteLine(Char.ToUpper(c));
Console.WriteLine(Char.ToUpperInvariant(c));
}
}