subString方法
package day01;
/**
*
* @author soft01
*
*/
public class String_substring {
public static void main(String[] args) {
// 01234567890123
String str = "www.oracle.com";
/**
* 通常用两个数字表示范围时,都是含头不含尾的
*/
String sub = str.substring(4,10);
System.out.println(sub);
sub = str.substring(4);
System.out.println(sub);
String host = "http://www.oracle.com";
int start = host.indexOf(".")+1;
int end = host.indexOf(".",start);
System.out.println(sub);
}
}