问题
I have a list
known as orgList
in which there are around 10 values present. i have input given by user. i have to search whether that input
is present in the list or not.
Can anybody suggest me how can i do that in apache free marker
. better if without using loop. because I have to use code in oracle digital assistant
.
回答1:
You can do that with the expression orgList?seq_contains(input)
, which returns a boolean. So for example it can be used like <#if orgList?seq_contains(input)>...</#if>
.
来源:https://stackoverflow.com/questions/61830354/searching-value-in-a-list-in-apache-free-marker