/**
* 截取字符串类
*/
package test;
public class Split {
public static void main(String[] args) {
// String s1="an angelDeclan《Thank you》,I wish I had your pair of
// wingsHad them last in my dreamsI, was chaising butterfliesTill the
// sunrise broke my eyes";
// String[] referealReasons = s1.split(",");
// for(int m=0;m<referealReasons.length;m++){
// // System.out.println(referealReasons[m]);
// }
// // 字符串1
String abc = "abcdefg";
// 字符串2
String aa = "aa.|bb.|cc.|dd.|ee.|ff.|gg";
String result = abc.substring(abc.length() - 3); // 截取后三位
String result1 = abc.substring(2, 5);
// 使用split方法,将字符串进行截取
String[] result2 = aa.split("\\."+"\\|");
for (int m = 0; m < result2.length; m++) {
System.out.println("输出结果:" + result2[m]);
}
}
}