String.Format (2) 썸네일형 리스트형 String.Format 할 때 자리수 맞추기 단순 예제 int aa = 3; str = String.Format("{0:000}", aa); 결과 : 003 UInt32 aa = 10; string s = String.Format("{0:X3}", aa); 결과 00A UInt32 aa = 10; string s = String.Format("{0:x3}", aa); 결과 00a c#에서 String.Format 형식 타입 지정하기 MSDN을 검색하다 굉장히 유용(?) 할것 같은 예제가 있길래 퍼왔다. 출저는 발켰으니 괜찮겠지.. 친절하게 MSDN에 소스 복사하기까지 있으니까 ㅡㅡ; // This code example demonstrates the String.Format() method. // Formatting for this example uses the "en-US" culture. using System; class Sample { enum Color {Yellow = 1, Blue, Green}; static DateTime thisDate = DateTime.Now; public static void Main() { // Store the output of the String.Format method in a stri.. 이전 1 다음