Template:Ifeqany/doc

Revision as of 16:13, 26 October 2020 by Caleb Cooper (talk | contribs) (Created page with "{{Documentation subpage}}__NOTOC__ <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> This template compares the first unnamed parameter to each of the subsequent (unnamed)...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This content is in the Template Namespace. Used for page-templates that can be re-used across the wiki.

This template compares the first unnamed parameter to each of the subsequent (unnamed) parameters (up to two dozen). The output of the template is specified by optional parameters {{{y}}} and {{{n}}}.

Example

Code

# {{ifeqany|ɪ|ɪ|ɛ|æ|ɒ|ʌ|ʊ|i|e|ɑ|ɔ|o|u|a|ɜ|ə|ɨ}}
# {{ifeqany|%|ɪ|ɛ|æ|ɒ|ʌ|ʊ|i|e|ɑ|ɔ|o|u|a|ɜ|ə|ɨ}}
# {{ifeqany|ɪ|ɪ|ɛ|æ|ɒ|ʌ|ʊ|i|e|ɑ|ɔ|o|u|a|ɜ|ə|ɨ|y=found a match|n=didn't find a match}}
# {{ifeqany|%|ɪ|ɛ|æ|ɒ|ʌ|ʊ|i|e|ɑ|ɔ|o|u|a|ɜ|ə|ɨ|y=found a match|n=didn't find a match}}

Result

  1. 1
  2. 0
  3. found a match
  4. didn't find a match

Details

  • If both {{{y}}} and {{{n}}} are specified, the template returns {{{y}}} if there is a match or {{{n}}} otherwise.
  • If only one of {{{y}}} or {{{n}}} is specified, the template returns nothing in place of the unspecified one.
  • If neither {{{y}}} nor {{{n}}} are specified, the template returns 1 if there is a match or 0 otherwise.

See also

{{ifeqall}}
Compares one comparison string against up to 10 case strings with optional result string and default result string outputs.
{{ifequal}}
Compares up to 16 comparison strings against an equal number of case strings.
{{ifor}}
Compares up to 30 comparison strings against an equal number of case strings with optional result string and default result string outputs.