80,351
社区成员
发帖
与我相关
我的任务
分享
String ss=section.getName();
ss=ss.trim();
ss=ss.toString();
String aa;
aa=ss.valueOf(ss);
name=name.trim();
name=name.toString();
String bb;
bb=name.valueOf(name);
int aaa=aa.length();
int bbb=bb.length();
boolean a_t= aa.contains(bb.subSequence(0, bb.length()));
boolean b_t=bb.contains(aa.subSequence(0, aa.length()));
if((b_t||a_t)&&(aa.length()==bb.length()))
{
return section;
}
最后用这个方法解决的。。for (IniSection section : getSections())
/* */ {
String ss=section.getName();
ss=ss.trim();
ss=ss.toString();
section2=section;
//ss.offsetByCodePoints(0, 0);
String aa;
aa=ss.valueOf(ss);
name=name.trim();
name=name.toString();
String bb;
bb=name.valueOf(name);
int aaa=aa.length();//aaa=5
int bbb=bb.length();//bbb=5
if(aa.length()==bb.length())//成立
{
CharSequence cc;
cc=aa.subSequence(0, aa.length());
CharSequence dd;
dd=bb.subSequence(0, bb.length());
if(cc.equals(bb))//不成立
{
return section;
}
}
/* 491 */ if (aa.equals(bb)) {//不成立
/* 492 */ return section;
/* */ }
/* */ }