Replace Arabic numerals with uppercase letters, and Arabic numerals with uppercase letters.

Source: Internet
Author: User

Replace Arabic numerals with uppercase letters, and Arabic numerals with uppercase letters.

Essay ------ extract useful.

 

/**
* @ Description
* @ Author
* @ Date 1:43:25
*/
Package com. yunfan. tmcc. ivr. util;
/**
* @ Description
* @ Author
* @ Date 1:43:25
*/
/**
* @ Description
* @ Author
* @ Date 1:43:25
*/
Public class ReplaceNumber {
/**
*
* @ Description
* @ Param args
* Void return type
*/
Public static void main (String [] args ){
String I = "IVR 1234567890 ";

Char [] aa = I. toCharArray ();
String cc = "";
String a = "";
For (int j = 0; j <aa. length; j ++ ){
If (aa [j] <= '9' & aa [j]> = '0 '){
A = numToUpper (aa [j]);
} Else {
A = "" + aa [j] + "";
}
Cc + =;
}
System. out. println (cc );
}
Public static String numToUpperr (String num ){
Char [] aa = num. toCharArray ();
String cc = "";
String a = "";
For (int j = 0; j <aa. length; j ++ ){
If (aa [j] <= '9' & aa [j]> = '0 '){
A = numToUpper (aa [j]);
} Else {
A = "" + aa [j] + "";
}
Cc + =;
}
Return cc ;}

// Convert the number to uppercase
Public static String numToUpper (char num ){
// String u [] = {"zero", "one", "two", "three", "Si", "Wu", "Lu", "Lu ", "identifier", "identifier "};
String u [] = {"0", "1", "2", "3", "4", "5", "6", "7 ", "8", "9 "};
Char [] str = String. valueOf (num). toCharArray ();
String rstr = "";
For (int I = 0; I <str. length; I ++ ){
Rstr = rstr + u [Integer. parseInt (str [I] + "")];
}
Return rstr;
}

}

Related Article

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.