24,530 ARTICLES
ON THIS WIKI

Template:XOR/doc


This template functions as a binary XOR operation. It will only return a value if only the first or only the second parameter is given, but not if both are.

Syntax[edit]

{{XOR|<condition 1>|<condition 2>|<true output>|<false output>}}

Examples[edit]

  • {{XOR|foo|bar}} gives (nothing)
  • {{XOR|foo|}} gives true
  • {{XOR||bar}} gives true
  • {{XOR||}} gives (nothing)
  • {{XOR|foo|bar|yup|nope}} gives nope
  • {{XOR|foo||yup|nope}} gives yup
  • {{XOR||bar|yup|nope}} gives yup

See also[edit]