문제

I'm new to freemarker. eg: a variable named content = "http://www.xyz.com/sites/" . so how to check in ftl

        <#if content has "/sites/" in it>
                  do something
        </#if>
도움이 되었습니까?

해결책

You can use a regular expression and the matches freemarker builtin.

<#if content?matches(".*/sites/.*")>
   do something
</#if>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top