String.substring(int beginIndex)
public class Main {
public static void main(String[] args) {
String sports = "soccer,baseball,basketball";
System.out.println(sports.substring(7));
}
}
Execution result
baseball,basketball
String.substring(int beginIndex, int endIndex)
public class Main {
public static void main(String[] args) {
String sports = "soccer,baseball,basketball";
System.out.println(sports.substring(7, 15));
}
}
Execution result
baseball
Java (tm) Platform, Standard Edition 8 API Specifications
Recommended Posts