求教千位分割符 的问题.在线等
请问怎么去掉千位分割符?就是123,456.00时 去掉123后面的,号
------解决方案--------------------public class Sqlit {
public static String constr = "456,789,700.008 ";
public static void main(String[] args) {
getStr();
}
/**
*
*/
private static void getStr() {
String str= " ";
String str1= " ";
int a=0;
int b=0;
a=constr.indexOf( ', ');
if(a==-1){
str1=constr;
}else{
str=constr.substring(0,a);
str+=constr.substring(a+1, constr.length());
b=str.indexOf( ', ');
if(b==-1){
str1=str;
}else{
str1=str.substring(0, b);
str1+=str.substring(b+1, str.length());
}
}
System.out.println( "===ahfad as=== "+str1);
}
}lz试试