Christian
Christian

Reputation: 26397

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

I have an NSUrl object and want to read the file name. While searching for existing solutions on StackOverflow I found https://stackoverflow.com/a/19964302/25282 which is for iOS but it uses syntax like return [yourURL lastPathComponent]; where it is unclear to me how to translate it into the C# that I have to use in Xamarin.iOS.

Upvotes: 0

Views: 544

Answers (1)

Jason
Jason

Reputation: 89127

the equivalent C# for this Obj-C code

return [yourURL lastPathComponent];

is

return yourURL.LastPathComponent;

where yourURL is a NSUrl;

Upvotes: 2

Related Questions