Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

c#
string
uppercase
communitycreatpr

What is string.ToUpper() in C#?

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The ToUpper() function converts a string to uppercase.

The following figure shows a visual representation of the ToUpper() function.

Figure 1: Visual representation of ToUpper() function

Syntax

string_name.ToUpper()

string_name is the name of the string which is to be converted to uppercase

Parameter

The ToUpper() function does not require a parameter.

Return value

The ToUpper() function returns a string that is converted to uppercase.

Code

class String
{
static void Main()
{
//string
System.Console.WriteLine("('educative').ToUpper(): "+ ("educative").ToUpper());
//string with number
System.Console.WriteLine("('educative09').ToUpper(): "+ ("educative09").ToUpper());
}
}

RELATED TAGS

c#
string
uppercase
communitycreatpr

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring