1 Importjava.util.ArrayList;2 Importjava.util.List;3 Public classThe s number is changed to uppercase {4 String str;5 s number is changed to uppercase (String str) {6 This. str =str;7 }8 voidf () {9List<string> List1 =NewArraylist<string>();TenList<string> List2 =NewArraylist<string>(); OneString s = "0 One and three Woolu qi Ba Jiu"; A intj = 0; - for(inti = 0; I < 10; i++) { -List1.add (i + "")); theList2.add (S.charat (j + +) + ""); - } - - for(inti = 0; I < str.length (); i++) { + - if(Str.charat (i) >= ' 0 ' && str.charat (i) <= ' 9 ') { + intK = List1.indexof (Str.charat (i) + ""); A System.out.print (List2.get (k)); at}Else { - System.out.print (Str.charat (i)); - } - } - } - Public Static voidMain (string[] args) { inThe S number is changed to uppercase A =NewThe S number is changed to uppercase ("fdsfds334"); - a.f (); to } +}
Change the number to uppercase