Template:Str endswith: Difference between revisions
m 1 revision imported |
m 1 revision imported |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{#invoke: | {{#ifeq:{{{1|a}}}{{{2|a}}}|{{{1|b}}}{{{2|b}}}|{{#invoke:String|endswith|source={{{1}}}|pattern={{{2}}} }}|yes<!--backward compatibility -->}}<noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> | ||
Latest revision as of 22:00, 1 August 2019
yes
| This template uses Lua: |
This is the {{str endswith}} meta-template.
It returns "yes" if the first parameter ends with the second parameter. Both parameters are trimmed before use.
Examples
{{str endswith|foo (bar)|(bar)}}→ yes{{str endswith|foo|bar}}→{{str endswith|(bar)|foo (bar)}}→{{str endswith|foo bar | bar}}→ yes
- border cases
{{str endswith}}→ yes{{str endswith||}}→ yes{{str endswith|| }}→ yes{{str endswith| |}}→ yes