首页 > 代码库 > zuoyeQAQ
zuoyeQAQ
public class StringAPIDemo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str1="耿丹计算机Java20170320";
System.out.println(str1.charAt(9));
System.out.println(str1.charAt(10));
System.out.println(str1.charAt(11));
System.out.println(str1.charAt(12));
System.out.println(str1.charAt(13));
System.out.println(str1.charAt(14));
System.out.println(str1.charAt(15));
System.out.println(str1.charAt(16));
}
}
public class StringAPIDemo12 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str="耿丹计算机Java20170320";
String newStr=str.replaceAll("Java","J2EE");
System.out.println("替换之后的结果:"+newStr);
}
}
public class StringAPIDemo06 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str1=" 耿丹 计算机 Java 20170320 ";
System.out.println(str1.trim());
}
}
zuoyeQAQ