支持库:Int32扩展
public static class Int32Extensions { public static string ToChineseMonth( int num) { if (num == 0 || num > 12) throw new Exception( "月份错误" ); string [] arr = { "〇" , "一" , "二" , "三" , "四" , "五" , "六" , "七" , "八" , "九" , "十" , "十一" , "十二" }; return arr[num]; } public static string ToChineseDay( int num) { if (num == 0 || num > 32) throw new Exception( "日期错误" ); string [] arr = { "〇" , "一" , "二" , "三" , "四" , "五" , "六" , "七" , "八" , "九" , "十" , "十一" , "十二" , "十三" , "十四" , "十五" , "十六" , "十七" , "十八" , "十九" , "廿十" , "廿一" , "廿二" , "廿三" , "廿四" , "廿五" , "廿六" , "廿七" , "廿八" , "廿九" , "三十" , "三十一" }; return arr[num]; } } |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步