I need to get the last part of current directory, for example from /Users/smcho/filegen_from_directory/AIRPassthrough, I need to get AIRPassthrough
/Users/smcho/filegen_from_directory/AIRPassthrough
AIRPassthrough
You can also use the Uri class.
new Uri("file:///Users/smcho/filegen_from_directory/AIRPassthrough").Segments.Last()
You may prefer to use this class if you want to get some other segment, or if you want to do the same thing with a web address.