猜测楼主的意思大概是这样的吧- package com.itheima;
- public class Demo1 {
- private final static String[] STR_NUMBER = { "0零", "1壹", "2贰", "3叁", "4肆", "5伍",
- "6陆", "7柒", "8捌", "9玖" }; // 大写数字
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- String value = "1,2,3";
- StringBuilder sb = new StringBuilder();
- String[] nums = value.split(",");
- for(String num:nums){
- sb.append(STR_NUMBER[Integer.parseInt(num)]);
- }
- System.out.println(sb);
- }
- }
复制代码 |