NSUrl url = new NSUrl("https://www.example.com/path?param1=value1#fragment"); string urlString = url.ToString(); Console.WriteLine(urlString); // Output: https://www.example.com/path?param1=value1#fragment
string urlString = "https://www.example.com/path?param1=value1#fragment"; NSUrl url = new NSUrl(urlString); string newUrlString = new NSUrl(url.ToString()).ToString(); // Should be the same as urlStringPackage/library: The NSUrl class is part of the Xamarin.iOS framework, which is an open-source library that provides access to Apple's iOS libraries and APIs for C# developers.