/**
* @详解关于subString()和indexOf()的用法,怎么联合使用
* @author 小夜的传说
*
*/
public
class
Test {
public
static
void
main(String[] args) {
String str =
"my name is xiaoye's chuanshou"
;
str = str.substring(
6
);
System.out.println(str);
str = str.substring(
2
,
10
);
System.out.println(str);
String sr =
"my name is xiaoye's chuanshou"
;
String sx =
"is"
;
int
index = sr.indexOf(sx);
System.out.println(index+
"<<<<"
);
int
index2 = sr.indexOf(sx,
3
);
System.out.println(index2+
"<<<<<"
);
String str2=
"<12453>123"
;
System.out.println(str2.indexOf(
"wwww"
));
System.out.println(str2.substring(str2.indexOf(
"123"
)+
1
,
9
)+
"<<<<<<"
);
}
}