Để chuyển đổi chữ hoa thành chữ thường, hãy sử dụng phương thức ToLower () trong C #.
Giả sử chuỗi của bạn là -
str = "TIM";
Để chuyển đổi chuỗi chữ hoa ở trên thành chữ thường, hãy sử dụng phương thức ToLower () -
Console.WriteLine("Converted to LowerCase : {0}", str.ToLower()); Sau đây là đoạn mã trong C # để chuyển đổi chữ hoa chữ thường -
Ví dụ
using System;
using System.Collections.Generic;
using System.Text;
namespace Demo {
class MyApplication {
static void Main(string[] args) {
string str;
str = "TIM";
Console.WriteLine("UpperCase : {0}", str);
// convert to lowercase
Console.WriteLine("Converted to LowerCase : {0}", str.ToLower());
Console.ReadLine();
}
}
}