EN
C# / .NET - convert string to uppercase
0 points
In this article, we would like to show you how to convert string to uppercase in C#.
Quick solution:
xxxxxxxxxx
1
string text = "abcd";
2
3
string textUpper = text.ToUpper();
4
5
Console.WriteLine(textUpper); // ABCD
In this example, we use toUpper()
method to convert the text
string to uppercase.
xxxxxxxxxx
1
using System;
2
3
public class Program
4
{
5
public static void Main()
6
{
7
string text = "abcd";
8
9
string textUpper = text.ToUpper();
10
11
Console.WriteLine(textUpper); // ABCD
12
}
13
}
Output:
xxxxxxxxxx
1
ABCD