![]() |
VOOZH | about |
In C#, the ToLower() method is a string method used to convert all uppercase characters in a string to lowercase. If a character does not have a lowercase equivalent, such as a special symbol, it remains unchanged. This method is particularly useful when performing case-insensitive string comparisons or formatting text.
Example 1: Basic Usage of ToLower() Method
String before conversion: geeksforgeeks String after conversion: geeksforgeeks
Explanation: In this example, the method converts all uppercase letters to lowercase while keeping other characters unchanged.
This method can be overloaded by passing the different types of arguments to it.
public string ToLower ();
public string ToLower(System.Globalization.CultureInfo culture);
Example 2: Handling Special Characters
String before conversion: This is C# Program XSDD_$#% String after conversion: this is c# program xsdd_$#%
Explanation: In this example, the method converts uppercase letters to lowercase while special symbols remain unchanged.
Example 3: Using ToLower() with CultureInfo
Original string: THIS IS C# PROGRAM XSDD_$#% String after conversion: this is c# program xsdd_$#%
Explanation: In this example, the method uses culture-specific rules to convert uppercase letters to lowercase.
Important Points: