Java 中replaceAll如何忽略大小写呢? 方式一:在正则表达式前面添加(?i) @Test public void test_replaceAll33(){ String input = "I like Java,jAva is very easy and jaVa is so popular."; String replacement="cccc"; System.out.println(input); System.out.println(input.
先读进字符串,然后再用split分割,注意当默认间隔符有其他意义时,要用\转义字符转义 这道题是pat的一道题,主要读入方法看前面就行了 import java.util.Scanner; public class A { public static void main(String[] args) { // TODO Auto-generated method stub Scanner keyIn = new Scanner(System.in); while(keyIn.hasNext())