对字符串“23 10 -8 0 3 7 108”进行升序2排序后,生成一个数值有序的字符串
public String void sortNumberString(){
String s=''30 10 -8 0 3 7 108";
String[]a=s.split(" ");
int[]b=new int[](a.size());
for(int i=0;i<a.size();i++){
b[i]=Integer.parseInt(a[i]);
}
public void sort(String[] b){
Arrays.sort(b);
}
StringBuilder sb=new StringBuilder();
for(int j=0;j<b.size();j++){
if(j!=b.size()-1)
sb.append(b[i]+" ")
else{ sb.append(b[i]); }
}
system.out.print(sb.toString());
}