java怎么将1,000转为整数?   

解决方案 »

  1.   

    String s="1000";
    int i=Integer.parseInt(s);
    当然, 感觉这好像不是你要问的。。
      

  2.   

    如果都是这么一种格式的话 可以去除, /**
     * @param args
     */
    public static void main(String[] args) {
    String x = "1,000";
    System.out.println(x.replace(",", ""));
    }
      

  3.   


    如果都是类似于这种的话
    DecimalFormat df=new DecimalFormat("0,000");
    Number num=df.parse("1,000");
    System.out.print(num);