What is string.ToLower() in C#?

The ToLower() function converts a string to lowercase.

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

Figure 1: Visual representation of ToLower() function

Syntax

string_name.ToLower()

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

Parameter

The ToLower() function does not require a parameter.

Return value

The ToLower() function returns a string that is converted to lowercase.

Code

class String
{
static void Main()
{
//string
System.Console.WriteLine("('EDUCATIVE').ToLower(): "+ ("EDUCATIVE").ToLower());
//string with number
System.Console.WriteLine("('EDUCATIVE09').ToLower(): "+ ("EDUCATIVE09").ToLower());
}
}
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources