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

String方法的应用:

时间:2018-12-08 18:30:26      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:ati   bsp   dem   world   pack   boolean   ack   start   sys   

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方法的应用:

标签:ati   bsp   dem   world   pack   boolean   ack   start   sys   

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

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