I need to parse the domain name from a string. The string can vary and I need the exact domain.
Examples of Strings:
http://somename.de/
www.somename.de/
somename.de/
somename.de/somesubdirectory
www.somename.de/?pe=12
I need it in the following format with just the domain name, the tld
, and the www
, if applicable:
www.somename.de
How do I do that using C#?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…