public class StringDemo{
public static void main(String[] args){
String text="Have a nice day:)";
System.out.println("原文:"+text);
System.out.println("大写:"+text.toUpperCase());
System.out.println("小写:"+text.toLowerCase());
System.out.println("长度:"+text.length());
System.out.println("取代:"+text.replaceAll("nice","good"));
System.out.println("子字符串:"+text.subString(5));
}
}