How do I get the folder name from the full path of the application?

This is the file path below,

c:\projects\root\wsdlproj\devlop\beta2\text

Here "text" is the folder name.

How can I get that folder name from this path?

Edit
Report