Difference between revisions of "CountryCheck"

From Sega Retro

(too many nested ifs)
Line 1: Line 1:
 
<includeonly>{{#vardefine:country|}}{{#if:
 
<includeonly>{{#vardefine:country|}}{{#if:
{{#var:country}}||{{#if:{{#pos:{{{1|}}}|Japan}}|{{#vardefine:country|vardefine:country|Japan}}}}}}{{#if:
+
{{#var:country}}||{{#if:{{#pos:{{{1|}}}|Japan}}|{{#vardefine:country|Japan}}}}}}{{#if:
 
{{#var:country}}||{{#if:{{#pos:{{{1|}}}|United States}}|{{#vardefine:country|the United States}}}}}}{{#if:
 
{{#var:country}}||{{#if:{{#pos:{{{1|}}}|United States}}|{{#vardefine:country|the United States}}}}}}{{#if:
 
{{#var:country}}||{{#if:{{#pos:{{{1|}}}|United Kingdom}}|{{#vardefine:country|the United Kingdom}}}}}}{{#if:
 
{{#var:country}}||{{#if:{{#pos:{{{1|}}}|United Kingdom}}|{{#vardefine:country|the United Kingdom}}}}}}{{#if:

Revision as of 14:52, 25 March 2020


Quick and not-so-great template to extract country names from addresses.

{{CountryCheck|ldifrtjsua pofjkadsfA, United Kingdom}}

becomes

the United Kingdom