質問

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