Question

I'm trying to get the directory name from a path string using nant. However, whenever I use the following:

<property name="lastBackSlash" value="${string::last-index-of('${foldername}', '\')}" />

... this returns -1. I am sure the foldername contains a path with backslashes.

Am I doing something wrong?

Was it helpful?

Solution

Too many dollar signs, assuming of course, that foldername is a property.

<property name="lastBackSlash" value="${string::last-index-of(foldername, '\')}" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top