C #: Convert lowercase to uppercase

Source: Internet
Author: User
# Region converts the lowercase value to uppercase public static string currtochnnum (double currnum) {string sresult = ""; if (math. ABS (currnum) <1e-20) Return "Zero circle"; if (currnum <1e-20) sresult = "negative"; sresult = sresult + stringtochnnum (math. ABS (math. round (currnum, 2 )). tostring (); Return sresult;} Private Static string fournumtochnnum (string STR, string chnnum, ref Boolean pre) {string [] digits = {"0", "one ", "II", "San", "Si", "Wu", "Lu", "Jun"}; int I, j, Len; string sresult = ""; Len = Str. length; for (I = 0; I <Len; I ++) {J = STR [I]-48; If (0 = J) Pre = true; else {If (pre) sresult = sresult + "zero"; sresult = sresult + digits [J] + chnnum. substring (LEN-I-1, 1); Pre = false ;}} return sresult. trim () ;}// convert formatted lowercase strings into uppercase strings Private Static string stringtochnnum (string Str) {const string chnnum1 = "MB"; int I, Len, len1, level, start; string S1; string s; Boolean pre; string sresult = ""; Len = Str. indexof ('. '); Level = (LEN + 3)/4; len1 = Len % 4; If (0 = len1) len1 = 4; Start = 0; for (I = 1; I <= level; I ++) {pre = false; S = Str. substring (START, len1); S1 = fournumtochnnum (S, "", ref pre); If (s1.length> 0) sresult = sresult + S1 + chnnum1.substring (level-I, 1); Start = start + len1; len1 = 4;} Pre = false; S1 = fournumtochnnum (Str. substring (LEN + 1, math. min (2, str. length-len-1), "Angular", ref pre); // S1 = ""; if (s1.length = 0) S1 = "whole "; sresult = sresult + S1; return sresult;} # endregion

 

C #: Convert lowercase to uppercase

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.