Search code examples
nant

nant: Can I extract the last directory in a path?


In Nant, I would like to be able to extract the last name of the directory in a path.
For example, we have the path 'c:\my_proj\source\test.my_dll\'

I would like to pass in that path and extract 'test.my_dll'

Is there a way to easily do this?


Solution

  • See the script task. You can write custom code in C# or whatever, and return a value that you can assign to a property.