/*
* String substring(int start)
* String substring(int strat, int end)
* 此方法不改变自身,返回子字符串
*/
public static void testSubstring(){
StringBuffer sb = new StringBuffer("nakeno");
sb.substring(4);
System.out.println(sb); // nakeno
System.out .println(sb.substring(4)); // no
System.out .println(sb.substring(4,5)); // n
}
|
|