java String split
DEMO:
竖线:
1 String str ="s|345"; 2 String[] array = str.split("\\|"); 3 System.out.println(array.length);
换行:
1 String[] array = str.split("\r\n");
斜杠:
String ip = "/127.0.0.1"; System.out.println(ip.replaceAll("/", ""));
DEMO:
竖线:
1 String str ="s|345"; 2 String[] array = str.split("\\|"); 3 System.out.println(array.length);
换行:
1 String[] array = str.split("\r\n");
斜杠:
String ip = "/127.0.0.1"; System.out.println(ip.replaceAll("/", ""));