C샵 (NET)
82. (C#/NET) [Mac Os] [문법] Char.IsDigit 사용해 특정 문자 정수 값 구성 여부 확인
투케이2K
2024. 3. 17. 13:34
728x90
[개발 환경 설정]
개발 언어 : C# / NET

[소스 코드]
using System;
using System.Collections;
using System.Data;
using System.Diagnostics.Tracing;
using System.Text;
using System.Web;
namespace testProject {
// [프로그램 동작 클래스]
class Program {
// [메소드 수행]
static void Main(string[] args){
// [변수 선언 실시]
char one = '3';
char two = 'T';
char three = '투';
// [IsDigit 사용해 정수 값 여부 확인 수행]
bool result_1 = Char.IsDigit(one);
bool result_2 = Char.IsDigit(two);
bool result_3 = Char.IsDigit(three);
// [결과 출력]
Console.WriteLine($"");
Console.WriteLine($"------------------------------------------");
Console.WriteLine($"[Main] : [Log]");
Console.WriteLine($"------------------------------------------");
Console.WriteLine($"result_1 : {result_1}");
Console.WriteLine($"------------------------------------------");
Console.WriteLine($"result_2 : {result_2}");
Console.WriteLine($"------------------------------------------");
Console.WriteLine($"result_3 : {result_3}");
Console.WriteLine($"------------------------------------------");
Console.WriteLine($"");
}
}
}
[결과 출력]

728x90
반응형