DEMO:
竖线:
1 String str ="s|345"; 2 String[] array = str.split("\\|"); 3 System.out.println(array.length);
换行:
1 String[] array = str.split("\r\n");
时间: 2024-10-21 22:58:42
DEMO:
竖线:
1 String str ="s|345"; 2 String[] array = str.split("\\|"); 3 System.out.println(array.length);
换行:
1 String[] array = str.split("\r\n");