package lianxi; import java.awt.image.ConvolveOp; public class ZhengshuShuzu { public static void main(String[] args) { String str="1,3,5,7,9"; char []cha=new char[9]; int []arr=new int[5]; cha=str.toCharArray(); int j=0; System.out.println(cha); for(int i=0;i<str.length();i++){ char ch=cha[i]; if(ch!=','){ arr[j]=Integer.parseInt(String.valueOf(ch)); ; System.out.print(arr[j]); j++; } } } }