❔ What's the best way to test a URL that's it's valid?

I have a situation where the user can enter a URL if they so choose, but if they do, I want to ensure it's valid. How would I do that? Should I use a regular expression test or something else? Normally, this will be a website on the Internet in my case.
4 Replies
0xDEADBEEF
0xDEADBEEF14mo ago
Uri.TryCreate Method (System)
Creates a new Uri. Does not throw an exception if the Uri cannot be created.
Will Pittenger
Will PittengerOP14mo ago
OK. Thanks.
Mayor McCheese
Mayor McCheese14mo ago
IdnMapping Class (System.Globalization)
Supports the use of non-ASCII characters for Internet domain names. This class cannot be inherited.
Accord
Accord14mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server