2022-10-26 C# convert enum value to String 143 0 筆記下列舉值轉成字串形式的對應數字 結論.ToString("D")範例Enumpublic enum Urgency { VeryHigh = 1, High = 2, Low = 4 }WriteLineConsole.WriteLine(Urgency.High.ToString("D"));Output"2"參照C# numeric enum value as string - Stack Overflow PS5 回首頁