Convert dates to uppercase Chinese Characters Based on ASP. NET, and convert asp.net to uppercase
This article mainly introduces the use of ASP. NET converts the date format to uppercase Chinese characters, for example, "may" to "may, May". Let's take a look at how it works.
Let's not talk about the same thing. directly add the code.
// Convert the year to an uppercase Chinese Character public static string numtoUpper (int num) {return "Zero errors" [num]. toString ();} // converts the uppercase Chinese character "public static string monthtoUpper (int month) {if (month <10) {return numtoUpper (month );} else {if (month = 10) {return "";} else {return "" + numtoUpper (month-10 );}}} // convert the date to the uppercase Chinese Character public static string daytoUpper (int day) {if (day <20) {return monthtoUpper (day);} else {String str = day. toString (); if (str [1] = '0') {return numtoUpper (Convert. toInt16 (str [0]. toString () + "pick";} else {return numtoUpper (Convert. toInt16 (str [0]. toString () + "pick" + numtoUpper (Convert. toInt16 (str [1]. toString ()));}}}
Static void Main (string [] args) {string year = "2013"; string retur = string. empty; for (int I = 0; I <year. length; I ++) {retur + = numtoUpper (int. parse (year [I]. toString ())). toString ();} Console. writeLine (retur + "year"); retur = string. empty; string month = "12"; retur = monthtoUpper (Convert. toInt32 (month); Console. writeLine (retur + "month"); string day = "3"; retur = daytoUpper (Convert. toInt32 (day); Console. writeLine (retur + "day"); Console. readLine ();}
The above is the use of ASP. NET to convert all the content of the date format into uppercase Chinese characters, I hope the content of this article will be helpful for everyone to use ASP. NET.