1、Java判断String是否以某个字符串开头:
String mobile = "8618730600000";
System.out.println(mobile.startsWith("86"));//输出true
2、Java判断String是否以某个字符串结尾:
String mobile = "8618730600000";
System.out.println(mobile.endsWith("0000"));//输出true
1、Java判断String是否以某个字符串开头:
String mobile = "8618730600000";
System.out.println(mobile.startsWith("86"));//输出true
2、Java判断String是否以某个字符串结尾:
String mobile = "8618730600000";
System.out.println(mobile.endsWith("0000"));//输出true