String str = "sdfjsd232";
        str = str.replaceAll("\\D","");
        int i = Integer.parseInt(str);
        System.out.println(i);

将字符去掉,在转成数值型

posted on 2022-05-20 10:41  泽国江山入战图  阅读(192)  评论(0编辑  收藏  举报