substring(a,b) 表示位置a和位置b之间的字符串 左闭右开原则 以0开始计数 eg: String input="I love the world" String a=input.substring(0,3); System.out.println(a); 输出结果:I l subst