首页 > 代码库 > java第5次作业
java第5次作业
题目一:
public class HomeworkDemo01 {
public static void main(String[] args) {
String str = "耿丹学院物联网Java2017320";
System.out.println(str.substring(11));
}
}
题目二:
public class HomeworkDemo02 {
public static void main(String[] args) {
String str = "耿丹计算机Java20170320";
String newStr = str.replaceAll("Java", "J2EE");
System.out.println("替换后的结果:"+newStr);
}
}
题目三:
public class HomeworkDemo03 {
public static void main(String[] args) {
String str1="耿丹 计算机 Java 2017320";
String newStr = str1.replaceAll(" ", "");
System.out.println("替换后的结果:"+newStr);
}
}
题目四:
public class HomeworkDemo04 {
public static void main(String[] args) {
String str = "11011119980201xxxx";
System.out.println(str.substring(10,14));
}
}
java第5次作业