Java Reference
In-Depth Information
if (location1 == -1)
return null;
count--;
} while (count > 0);
location2 = str.indexOf(token2, location1 + 1);
if (location2 == -1)
return null;
return str.substring(location1 + token1.length(), location2);
}
/**
* Run the example.
*/
public void go()
{
try
{
URL u = new URL("http://www.httprecipes.com/1/3/time.php");
String str = downloadPage(u);
System.out.println(extract(str, "<b>", "</b>", 1));
} catch (MalformedURLException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
}
/**
* Typical Java main method, create an object, and then
* call that object's go method.
*
* @param args Not used.
*/
public static void main(String args[])
{
GetTime module = new GetTime();
module.go();
}
}
Search WWH ::




Custom Search