C# 程式,用於轉換字元大小寫
假設你的字串如下 −
str = "AMIT";
若要將上面的大寫字串轉換為小寫,請使用 ToLower() 方法 −
Console.WriteLine("Converted to LowerCase : {0}", str.ToLower());示例
以下是 C# 中用於轉換字元大小寫的程式碼。
using System;
using System.Collections.Generic;
using System.Text;
namespace Demo {
class MyApplication {
static void Main(string[] args) {
string str;
str = "AMIT";
Console.WriteLine("UpperCase : {0}", str);
// convert to lowercase
Console.WriteLine("Converted to LowerCase : {0}", str.ToLower());
Console.ReadLine();
}
}
}輸出
UpperCase : AMIT Converted to LowerCase : amit
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP