常用构造器及方法总结
// TODO Auto-generated method stub
char[] ch= {'h','e','l','l','o'};
String str1="hello.java";
String str2=new String(ch);
String str3=new String(ch,0,4);//起始index值,length
System.out.println(str3);
//常用方法
System.out.println(str2);
char c=str2.charAt(2);
int x=str2.compareTo(str1);
System.out.println(str1.contains("heo"));
String str4=str1.copyValueOf(ch,0,3);//ch char[]类型
System.out.println(str4);
System.out.println(str1.endsWith(".java"));
System.out.println(str1.startsWith("hel"));
System.out.println("############");
// byte[] stringToChar=str1.getBytes();
// for(byte ss:stringToChar) {
// System.out.print((char)ss);
// }
String str5=str1.replace(".java", ".class");
System.out.println(str5);
String str6=str1.substring(0, 5);
System.out.println(str6);
char[] chNew=str1.toCharArray();
System.out.println(chNew.length);
System.out.println(str1.toUpperCase());
String str7=String.valueOf(12);
System.out.println(str7);
System.out.println(Integer.parseInt(str7));