♦ ToUpper() in C#
♣ Example5: ToUpper() in C#
ToUpper() method converts all characters in string to upper case.In this example, ToUpper() is illustrated.
Example
Input:
xxxxxxxxxx
1
using System;
2
3
namespace Strings
4
{
5
class Program
6
{
7
static void Main(string[] args)
8
{
9
10
string s1="spaceX";
11
string s2="Ratchet";
12
13
string s3=s1.ToUpper();
14
Console.WriteLine(s3);
15
16
string s4=s2.ToUpper();
17
Console.WriteLine(s4);
18
19
20
}
21
}
22
}
23
Output:
1
1