startsWith(),endsWith()的作用

startsWith(),endsWith()的作用,用法,判断字符串a 是不是以字符串b开头或结尾

    if(a.startsWith(b))   
    //判断字符串a 是不是以字符串b开头.  

    if(a.endsWith(b))   
    //判断字符串a 是不是以字符串b结尾.  

 

posted @ 2013-12-11 18:13  Mr_Wangsg  阅读(363)  评论(0)    收藏  举报