Java中怎么將小寫阿拉伯數字轉換成中文大寫?
實現方法如下:
public class Admin { public static void main(String[] args) { String[] arr = { "零", "壹", "貳", "叁", "肆", "伍", "陸", "柒", "捌", "玖" }; String str = "123456"; char[] c = str.toCharArray(); for (int i = 0; i < c.length; i++) { int a = Integer.parseInt(String.valueOf(c[i])); System.out.print(arr[a]); } }}