判断是否以指定的字符串开头或结尾。
String str5 = "293陕西力拓888";
System.out.println(str5.startsWith("293"));
System.out.println(str5.endsWith("888"));
if(str5.startsWith("293")) {
System.out.println("293陕西力拓888"+"以293开头");
}
if(str5.endsWith("888")) {
System.out.println("293陕西力拓888"+"以888结尾");
}
}
添加微信进交流群: opiopi293