소문자를 대문자로 변환하려면 C#에서 ToUpper() 메서드를 사용하십시오.
문자열이 −
라고 가정해 보겠습니다.str = "david";
위의 소문자 문자열을 대문자로 변환하려면 ToUpper() 메서드를 사용하십시오 -
Console.WriteLine("Converted to UpperCase : {0}", str.ToUpper()); 다음은 C#에서 대소문자를 변환하는 코드입니다 -
예
using System;
using System.Collections.Generic;
using System.Text;
namespace Demo {
class MyApplication {
static void Main(string[] args) {
string str;
str = "david";
Console.WriteLine("LowerCase : {0}", str);
// convert to uppercase
Console.WriteLine("Converted to UpperCase : {0}", str.ToUpper());
Console.ReadLine();
}
}
}