.Net Pearls -1 System.IO.Path

It’s been a while since I wrote my lost blog post. I thought start it again. Recently I was looking for a get the extn for a file. Initially it took some time for me to get extension and finally I realized System.IO.Path

Two mostly use full methods in System.IO.Path
class is “GetFileName” and “GetExtension”

    var extn = System.IO.Path.GetExtension(@”c:\temp\text.txt”);

            // Result = .txt

 

    var fileName = System.IO.Path.GetFileName(@”c:\temp\text.txt”);

            //Result = text.txt

 

And finally there may other use full methods in in it.