public class Java1 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String str1="耿丹计算机Java20170321"; System.out.println(str1.substring(9)); } }
public class Java2 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String str="耿丹计算机Java20170321"; String newStr=str.replaceAll("Java","J2EE"); System.out.println(newStr); } }
public class Java3 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String str=" 耿丹 计算机 Java 20170321 "; String newStr=str.replaceAll(" ",""); System.out.println(newStr); } }