Pergunta

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?

Foi útil?

Solução

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

<property name="lastBackSlash" value="${string::last-index-of(foldername, '\')}" />
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top