public class zuoye { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String str1="耿丹计算机Java20170320"; System.out.println(str1.substring(1)); } }
public class zuoye1 { /** * @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 zuoye2 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String str1="耿丹 计算机 Java 2017320"; String newStr = str1.replaceAll(" ", ""); System.out.println("替换后:"+newStr); } }
public class zuoye3 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String str = "11010919990118xxxx"; System.out.println(str.substring(6,13)); } }