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

1月13日- startWith 和 endWith 的相同结果写法

时间:2016-01-13 21:59:01      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:

public class zifuchuanlianxi {

    public static void main(String[] args) {
        // TODO 自动生成的方法存根

        
        
        String str = "abcedjiakel";
        
        if (str.indexOf("abc")==0)
        {
            System.out.println("是以abc开始");
        }
        
        
        if (str.indexOf("l")==str.length()-1)
        {
            System.out.println("是以l结束");
        }



      //输出结果:是以abc开始
      //输出结果:是以l结束


        
    }

}

 

1月13日- startWith 和 endWith 的相同结果写法

标签:

原文地址:http://www.cnblogs.com/yifangtongxing/p/5128521.html

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