Domanda

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>
È stato utile?

Soluzione

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

<#if content?matches(".*/sites/.*")>
   do something
</#if>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top