本頁包含了對此模板的使用説明:Template:Abbcontains。 |
Template to check whether any member of a set of game abbreviations (used by e.g. {{Abb}}
is part of another set of abbreviations. Returns "1" if that is the case and an empty string otherwise.
Auxiliary template for Template:Infobox.
Usage
{{abbcontains|set of abbrevations|abbrevation(s) to check for}}
Parameters
<unnamed 2>
. An unlimited number of abbreviations can be specified if separated with sep
/sep1
(see below).<unnamed 1>
. Up to 10 abbreviations can be specified if separated with sep
/sep2
(see below). A wildcard (*
) can be used at the end of each abbreviation which will match any number of characters; e.g. "FO3*" will match both "FO3" and "FO3OA".<unnamed 1>
and <unnamed 2>
. If sep1
or sep2
are specified, they override this parameter for the corresponding unnamed
parameter.sep
")<unnamed 1>
. Overrides sep
.sep
")<unnamed 2>
. Overrides sep
.Examples
Simple
{{abbcontains|FO1, FO2, FO3|FO3}}
returns "1" because FO3 is among the abbreviations in the first set.
{{abbcontains|FO1, FO2, FO3|FNV}}
returns "" (an empty string) because FNV is not among the abbreviations in the first set.
Checking for multiple abbrevations
{{abbcontains|FO1, FO2, FO3|FO2, FO3}}
returns "1" because both FO2 and FO3 are among the abbreviations in the first set.
{{abbcontains|FO1, FO2, FO3|FO3, FOT}}
returns "1" because FO3 is among the abbreviations in the first set.
{{abbcontains|FO1, FO2, FO3|FOT, FOBOS}}
returns "" (an empty string) because neither "FOT" nor "FOBOS" are among the abbreviations in the first set.
Wildcards
{{abbcontains|FO1, FO2, FO3|FO3*}}
returns "1" because FO3 is among the abbreviations in the first set.
{{abbcontains|FO1, FO2, FO3OA|FO3*}}
returns "1" because FO3OA is among the abbreviations in the first set.
{{abbcontains|FO1, FO2, FOT|FO3*}}
returns "" (an empty string) because no abbreviation starting with FO3 is among the abbreviations in the first set.
Non-standard separators
{{abbcontains|FO1-FO2-FO3|FO3-FNV|sep=-}}
returns "1".
{{abbcontains|FO1-FO2-FO3|FO3.FNV|sep1=-|sep2=.}}
returns "1".