首页 > 其他 > 详细

String方法的应用:

时间:2018-12-08 18:21:00      阅读:156      评论:0      收藏:0      [点我收藏+]

package com.tets;

public class Demo2 {
       public static void main(String[] args){
           String str="Hello world";
           String str2="hello world";
             int len=str.length();
           boolean b=str.startsWith("H");
           boolean c=str2.contains("Hello");
           boolean d=str2.endsWith("d");
          System.out.println("字符串的长度是"+len);

          System.out.println(b+c+d);
       }
}

String方法的应用:

原文:https://www.cnblogs.com/yang-1yang/p/10088540.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!