'freemarker string split and substring

I have a string in the following format

aa_bbbbb_ccccc

length of aa is fixed and b's and c's are of variable length. I need to capture the bbbbb from this string using freemarker.



Solution 1:[1]

If s stores that string, the expression s?split('_')[1] evaluates to bbbbb.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ddekany