cancel
Showing results for 
Search instead for 
Did you mean: 

Freemarker substring function

simon
Champ in-the-making
Champ in-the-making
Alfresco,

I found this in the Freemarker documentation:
${'abc'?substring(0, 1)}
but it doesn't seem to work in Alfresco. Is this function supported or are there some version differences or other problems I don't know of? More importantly,when will this work?

Thanks!
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
This appears to be new syntax in version 2.3.7 of FreeMarker: http://freemarker.sourceforge.net/docs/versions_2_3_7.html

The docs say:
"Getting substrings was possible for a long time like myString[from..toInclusive] and myString[from..]. This syntax is now deprecated for getting substrings (but it's still working)"

So you can use that syntax. We will upgrade FreeMarker in a future version.

Thanks,

Kevin

simon
Champ in-the-making
Champ in-the-making
I supposed something like this but couldn't compare the versions and there was no indication at the string documentation page. Thanks Kevin!