首页 > 其他 > 详细

String

时间:2014-07-16 00:40:50      阅读:321      评论:0      收藏:0      [点我收藏+]
 1 package pro1;
 2 
 3 public class Pro1 {
 4 
 5     public static void main(String[] args) {
 6         // TODO code application logic here
 7         System.out.println("test");
 8         //ask for the word‘s length
 9         String s="welcome to beijin";
10         int len=s.length();
11         System.out.println(len);
12         //concat
13         String str="peggy";
14         System.out.println(s.concat(str));
15         str=str+s;
16         System.out.println(str);
17               
18       String s1="This" ;
19       String s2="That";
20       System.out.println("Result 1:"+s1.equals("this")+","+s1.equalsIgnoreCase("this"));
21       System.out.println("Result 2:"+s2.compareTo("That")+s2.compareTo(s1)+s2.compareTo("that"));
22        // if it return -32 states : "That"is smaller than "this"(T<t) only both they are same return 0;m                                                                                   23         
24     }
25 }

 

 

String,布布扣,bubuko.com

String

原文:http://www.cnblogs.com/zzblee/p/3845107.html

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