码迷,mamicode.com
首页 > 其他好文 > 详细

判断是否以指定的字符串开头或结尾。

时间:2020-07-13 18:25:51      阅读:48      评论:0      收藏:0      [点我收藏+]

标签:int   with   system   art   sys   字符串   back   ack   color   

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结尾");
}

}

判断是否以指定的字符串开头或结尾。

标签:int   with   system   art   sys   字符串   back   ack   color   

原文地址:https://www.cnblogs.com/wangffeng293/p/13294609.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!