I'm not trying to solve anything for me ;-) LastIndexOf suits my needs in this case, but I was just wondering why IndexOf doesn't exist in the library...
Because there's native support for this in xpath. It's called "substring-before" (http://www.zvon.org/xxl/XSLTreference/Output/function_substring-before.html).
umbraco.library has LastIndexOf, not IndexOf?!
Hi guys,
Can anyone explain to me, why the umbraco library does contain a LastIndexOf method, but does not contain a IndexOf method?
Interesting question!
In my experience I am usually in a for-each loop and can simply check the position(). Would that work for you?
Otherwise, maybe a quick little c# helper function in your xslt? For an example of how to do that, check out http://blog.percipientstudios.com/2009/9/21/advanced-xslt-with-net-namespaces.aspx
cheers,
doug.
Doug,
I'm not trying to solve anything for me ;-)
LastIndexOf suits my needs in this case, but I was just wondering why IndexOf doesn't exist in the library...
Bump ;-)
Because there's native support for this in xpath. It's called "substring-before" (http://www.zvon.org/xxl/XSLTreference/Output/function_substring-before.html).
:)
Niels...
is working on a reply...