Java 字符串操作
程序员文章站
2022-04-30 22:09:32
...
import java.util.Scanner;
public class Operation{
public static void main(String args[]){
String s="Java 技术学习班 20070326";
String s2="MLDN JAVA";
String s3="Java 技术学习班 20070326 MLDN 老师";
System.out.println(s.substring(11));
System.out.println(s2.replaceAll("JAVA","J2EE"));
System.out.println(s.charAt(8));
System.out.println(s.replaceAll("0",""));
System.out.println(s3.replaceAll(" ",""));
Scanner a=new Scanner(System.in);
String b=a.next();
System.out.println(b.substring(6,14));
}
}