StringDemo1.java
2008-05-18 10:59
267 查看
public class StringDemo{
public static void main(String[] args){
String text="hello";
System.out.println("字符串内容: "+text);
System.out.println("字符串长度:"+text.length());
System.out.println("等于hello? "+text.equals("hello"));
System.out.println("转为大写: "+text.toUpperCase());
System.out.println("转为小写: "+text.toLowerCase());
}
}
public static void main(String[] args){
String text="hello";
System.out.println("字符串内容: "+text);
System.out.println("字符串长度:"+text.length());
System.out.println("等于hello? "+text.equals("hello"));
System.out.println("转为大写: "+text.toUpperCase());
System.out.println("转为小写: "+text.toLowerCase());
}
}
相关文章推荐
- SplitStringDemo.java
- EasyDemo*Java 中关于String的空对象(null) ,空值(empty),空格的总结及小练习(on Github)
- StringDemo.java
- 对于java学习中的date与String转换demo
- StringMethodDemo.java
- JAVA中String与StringBuffer的区别
- Java堆、栈和常量池以及相关String的详细讲解(经典中的经典)
- 黑马程序员—— Java基础--String
- 基于Java使用HashMap<String,List<String>>实现数据的缓存
- java学习日记_62:String的其他功能
- java中string和int互相转化
- java中的字符串String
- JAVA中的String 以及Interger 类型的总结
- JAVA中int、String的类型转换
- 能不能自己写个类,也叫java.lang.String
- Java判断String为空
- java.sql.SQLException: Incorrect string value: '\xE6\x88\x91\xE7\x9A\x84...' for column 'groupName'
- 深入理解Java中的String
- java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8E' for column 'nick' at row 1
- Java String.split()用法小结