如何将月份名称更改为月份编号 [英] How to change month name to month number
本文介绍了如何将月份名称更改为月份编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将月份名称更改为月份编号。你们可以帮帮我........
谢谢,
Manasa
Hi,
I need to change month name as month number.Can you guys help me out........
Thanks,
Manasa
推荐答案
假设你不喜欢不想输出它们,或者想要能够使用用户月份名称:
Assuming you don''t want to type them out, or want to be able to use the users month names:
string monthName = "April";
int monthNo = DateTime.ParseExact(monthName, "MMMM", CultureInfo.CurrentCulture).Month;
您好
您可以随时使用Enum,了解它们的工作原理,我肯定会成功......
Hi
You can always use Enum, read about how they work,am sure ul make it...
这篇关于如何将月份名称更改为月份编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文