Hi
How would I parse a domain name in objective -c?
For example if my string value was "http://www.google.com" I would like to parse out the string "google"
Hi
How would I parse a domain name in objective -c?
For example if my string value was "http://www.google.com" I would like to parse out the string "google"
I think the question is a tiny bit invalid. A host is determined by its FQDN (fully qualified domain name) which, in your example, is www.google.com. It's not the same as mail.google.com or www.google.info or google.com. To single out "google" is not trivial and does not make much sense from URL perspective.
If you'd like to just parse the URL more-or-less intelligently, I think you can do the following: