如何判断一个字符串中包含另外一个字符串??
小兵比克 2011-09-26 09:18:39 我是这样写的:
private boolean isContain (String sooner, String later) {
int soonerLenth = sooner.length();
char[] chars = null;
later.getChars(0, soonerLenth-1, chars, 0);
String chars2string = new String (chars);
if (sooner == chars2string) {
return true;
} else
return false;
}
这样行吗??似乎在这里出错了。