Java第五次作业
1
public class Xx1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str1="耿丹计算机Java20170320";
System.out.println(str1.substring(9));
}
}
2
public class Xx2 {
/**
* @param args
*/
public static void main(String[] args) {
String str="耿丹计算机Java20170320";
String newStr=str.replaceAll("Java","J2EE");
System.out.println("替换为:"+newStr);
}
}
3
public class Xx3 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str1="耿丹计算机Java20170321";
System.out.println(str1.replace("0",""));
}
}
4
public class Xx4 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str="耿丹 计算机 Java 20170320";
String newStr=str.replaceAll(" ","");
System.out.println(newStr);
}
}
5
public class Xx5 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str="748522199807081465";
System.out.println(str.substring(6,14));
}
}