Find substring in the string in TWIG

前端 未结 1 1807
猫巷女王i
猫巷女王i 2020-12-08 18:03

I want to find substring of the string or check if there is no such substring using Twig. On the words, I need analogue of \'strstr\' or \'strpos\' in php. I googled and sea

相关标签:
1条回答
  • 2020-12-08 18:44

    Just searched for the docs, and found this:

    Containment Operator: The in operator performs containment test. It returns true if the left operand is contained in the right:

    {# returns true #}
    
    {{ 1 in [1, 2, 3] }}
    
    {{ 'cd' in 'abcde' }}
    
    0 讨论(0)
提交回复
热议问题