package Demo;
public class Demo4 { public static void main(String[] args) { String str = "helloworld"; System.out.println(str.substring(5)); //world 从指定位置截取到末尾 System.out.println(str.substring(0, 5)); //hello 截取指定范围的内容
}}