AJB AJB - 1 year ago 136
C# Question

How to remove www, http/https and other strings in URL in C#

For Example I have this string


What I want is to return only
I'm planning to use
but I think there are better approach for this question.

Answer Source

If you are working for Winforms then

string url = "http://www.merriam-webster.com/dictionary/sample";

UriBuilder ub = new UriBuilder(url);


and for web,

Get host domain from URL?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download