sm4
0
Q:

how to change a string into lowercase in C#

string author = "Mahesh Chand";  
string bio = "Mahesh Chand is a founder of C# Corner.";  
  
// Covert everything to uppercase  
string ucaseAuthor = author.ToUpper();          
Console.WriteLine($"Uppercase: {ucaseAuthor}");  
  
// Covert everything to lowercase  
string lcaseAuthor = author.ToLower();  
Console.WriteLine($"Lowercase: {lcaseAuthor}");  
  
// We can direct convert to uppercase or lowercase  
Console.WriteLine(bio.ToLower());  
Console.WriteLine(bio.ToUpper());  
8
/* Take an Input */
string str = Console.ReadLine();

/* Convert to Lower and store it in a itself
That means update the str variable and store it in itself. */
str = str.ToLower();

/* Print it. */
Console.WriteLine(str);

/* Input:-
Hello World */
/* Output:-
hello world */
0

New to Communities?

Join the community