截取字符串中某些字符

1
2
3
4
5
6
7
8
9
10
11
public class test
{
    public static void main(String[] args) {
        String s = "ABCDEFG";
        String s1 = null;
        s1 = s.replaceAll("CD", "");
        System.out.println(s1);
        String s2 = s1.replaceAll("B|F", "");
        System.out.println(s2);
    }
}

 

posted @   32ddd  阅读(216)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示