从 Xamarin.iOS 中的 NSUrl 获取文件名的最简单方法是什么?

What is the easiest way to get the file name from an NSUrl in Xamarin.iOS?

我有一个 NSUrl 对象,想读取文件名。在 Whosebug 上搜索现有解决方案时,我发现 用于 iOS 但它使用类似 return [yourURL lastPathComponent]; 的语法,我不清楚如何将其转换为我必须使用的 C#在 Xamarin.iOS.

此 Obj-C 代码的等效 C#

return [yourURL lastPathComponent];

return yourURL.LastPathComponent;

其中 yourURLNSUrl;