if(amount.length()>0 && amount.indexOf(",") >= 0) {
amount = amount.replaceAll(",", "");
}
java中经常会遇到字符串的拼接:
1、StringBuilder sb = new StringBuilder();
String[] b = new String()[3];
for(int i = 0; i<3; i++){
if(i==0){
sb.append("b[i]");
}else{
sb.append(",").append("b[i]");
}
}
sb = sb.substring(0,sb.length()-1);