I need to go through a large list of string url\'s and extract the domain name from them.
For example:
http://www.stackoverflow.com/questions
You could write a regexp? http:// is always the same, and then match everything until you get the first '/'.
Assuming that they're all well-formed URLs, but you dont' know whether they'll be http://, https://, etc.
int start = theUrlString.indexOf('/');
int start = theUrlString.indexOf('/', start+1);
int end = theUrlString.indexOf('/', start+1);
String domain = theUrlString.subString(start, end);