Domanda

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?

È stato utile?

Soluzione

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

<property name="lastBackSlash" value="${string::last-index-of(foldername, '\')}" />
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top