올바른지 이해하면 할당 된 int 값이있는 열거 형 목록이 있습니다. 나는이 값을 문자열이 아닌 int로 간주하는 방법이 있습니까?C# 열거 형 숫자 값으로, 해당 값을 문자열로 읽으시겠습니까?
내 열거
public enum CsvRowFormat
{
BeginningOfFile = 01,
School = 02,
Student = 03,
EndOfFile = 04
}
현재 내가
studentRowFormat.AppendFormat("0{0}",(int)TransactionFile.CsvRowFormat.Student).ToString();
"0"+ (int) TransactionFile.CsvRowFormat.Student – kenny
@kenny 그는 이미 그가 사용하고 있다고 말했습니다. – Servy
[표준 숫자 형식] (http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx)을 살펴보십시오. '{0 : D2} '를 사용하면 앞에 0이 붙은 1 자리 값을 출력합니다. –