我这有个现成的代码,你看能不能解决你的问题
/* *** delete HTML from st *** */
public boolean myDeleteHTML(UtilStreamTokenizer st, int myBeginIndex)
{
int myLocal = myBeginIndex + st.loc;
int myNewLocal = 0; /* *** for Loop search HTML Code *** */
for (int i = 0; i < myHTMLLocalVector.size(); i++)
{
int myFrom = ( (Integer) ( (Vector) myHTMLLocalVector.get(i)).get(0)).
intValue();
int myTo = ( (Integer) ( (Vector) myHTMLLocalVector.get(i)).get(1)).
intValue(); /* *** if this Local is HTML Code Local *** */
if (myLocal >= myFrom && myLocal < myTo)
{
myNewLocal = myTo + 1;
}
}
/* *** delete HTML from st *** */
public boolean myDeleteHTML(UtilStreamTokenizer st, int myBeginIndex)
{
int myLocal = myBeginIndex + st.loc;
int myNewLocal = 0; /* *** for Loop search HTML Code *** */
for (int i = 0; i < myHTMLLocalVector.size(); i++)
{
int myFrom = ( (Integer) ( (Vector) myHTMLLocalVector.get(i)).get(0)).
intValue();
int myTo = ( (Integer) ( (Vector) myHTMLLocalVector.get(i)).get(1)).
intValue(); /* *** if this Local is HTML Code Local *** */
if (myLocal >= myFrom && myLocal < myTo)
{
myNewLocal = myTo + 1;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货