Hi everyone,
I’m looking for a way to see if a specific word is contained within another word!
For example:
Is the word ‘dash’ contained within the word ‘dashboard’?
Is this possible? If so, how do I do it?
Thanks for all your responses.
Hi everyone,
I’m looking for a way to see if a specific word is contained within another word!
For example:
Is the word ‘dash’ contained within the word ‘dashboard’?
Is this possible? If so, how do I do it?
Thanks for all your responses.
Templates:
{% set s = "this sentence contains the word dash in it." %}
{{ "dash" in s }}
will return true.
Thanks for your response.
What you’re doing is a word within a sentence, I mean part of a word within a word,
as in my example.
Is the word ‘dash’ contained within the word ‘dashboard’
Is there also a way that takes into account whether the search term and keyword are in capital letters or not.
That also works, unless you want it not to find separate occurrences.
Previous example is case-sensitive. This one isn’t:
{% set s = "DaShBoArD" %}
{{ "dash" in s.lower() }}