Java Reference
In-Depth Information
// convert everything to lower case
String searchStr = str.toLowerCase();
token1 = token1.toLowerCase();
token2 = token2.toLowerCase();
// now search
location1 = location2 = 0;
do
{
location1 = searchStr.indexOf(token1, location1 + 1);
if (location1 == -1)
return null;
count--;
} while (count > 0);
location1 += token1.length();
// return the result from the original string that has mixed
// case
location2 = str.indexOf(token2, location1 + 1);
if (location2 == -1)
return null;
return str.substring(location1, location2);
}
/**
* Process the specified URL and extract data from all of
* the sub pages
* that this page links to.
* @param url The URL to process.
* @throws IOException Thrown if an error occurs while
* reading the URL.
*/
public void process(URL url) throws IOException
{
String value = "";
InputStream is = url.openStream();
ParseHTML parse = new ParseHTML(is);
int ch;
while ((ch = parse.read()) != -1)
Search WWH ::




Custom Search