测试2

package DEMO01;

import java.util.Scanner;

public class Demo2 {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        System.out.println("输入字符串");
        String str=sc.next();
        String s=str.replaceAll("[^0-9]", "");
        System.out.println("原:"+str+"\n\n筛:"+s);
    }

}

 

posted @ 2019-08-11 20:54  HxTZzz  阅读(92)  评论(0编辑  收藏  举报