سانچہ:Find demonym
لوا خطا ماڈیول:Lua_banner میں 113 سطر پر: attempt to index field 'edit' (a nil value)۔
Extracts from string the demonym (adjective) of a continent or country (African, Indian, British etc). Returns nothing if there is no match.
Note that the demonym in the string must properly capitalised. "Indian" will be matched, but "indian" or "INDIAN" will be ignored.
The list of countries is hard-coded in a list in Module:Find demonym, based on the list in {{Iso2nationality}} with a few additions.
Some options allow its behaviour to be configured.
Usage
[ترمیم]Basic usage
[ترمیم]{{Find demonym|Foo}}
This usage will return the first time in string Foo which matches the correctly-capitalised demonym of a continent or country.
If no match is found, it returns an empty string. This allows its simple use in templates, e.g.
{{#if: {{Find demonym}}|<!-- do nothing if there is a match -->|This string does not include a demonym}}
Optional parameters
[ترمیم]One parameter is obligatory, two optional parameters are available:
|string=value
- This forces the template to use a title other than the current page
|nomatch=value
- This parameter is used to specify a message to be generate if no match is found. For example
- Default output
{{Find demonym|The quick brown fox jumps over the lazy dog}}→ اسکرپٹ نقص: «Find demonym» کے نام سے کوئی ماڈیول نہیں ہے۔ - with nomatch
{{Find demonym|The quick brown fox jumps over the lazy dog|nomatch=No demonym!}}→ اسکرپٹ نقص: «Find demonym» کے نام سے کوئی ماڈیول نہیں ہے۔
- Default output
|match=number
- If multiple demonyms are found, this specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1.
- Examples:
{{Find demonym|Some Bangladeshi, Indian and Pakistani (and maybe Sri Lankan) cricketers|match=2}}→ اسکرپٹ نقص: «Find demonym» کے نام سے کوئی ماڈیول نہیں ہے۔{{Find demonym|Some Bangladeshi, Indian and Pakistani (and maybe Sri Lankan) cricketers|match=-2}}→ اسکرپٹ نقص: «Find demonym» کے نام سے کوئی ماڈیول نہیں ہے۔
TemplateData
[ترمیم]معلومات سانچہ Find demonym
Extracts a demonym from a string. All parameters are optional.
| پیرامیٹر | وضاحت | طرز | حالت | |
|---|---|---|---|---|
| Search string | string | String to search for demonym. If left blank, the template will return a blank, the bare module will use the page name | اِسٹرنگ | اختیاری |
| Match Instance | match | If multiple demonyms are found, this specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1.
| عدد | اختیاری |
| No match text | nomatch | If no demonyms are found, output the "nomatch" value. Defaults to blank. | اِسٹرنگ | اختیاری |
| اوپر دی گئی دستاویز صفحہ سانچہ:Find demonym/دستاویز سے شامل کی گئی ہے۔ (ترمیم | تاریخچہ) صارفین سانچہ کے تختہ مشق (تخلیق | آئینہ) اور ثابتات (تخلیق) میں تجربات کرسکتے ہیں۔ براہ کرم /دستاویز کے ذیلی صفحہ پر زمرہ جات شامل فرمائیں۔ اس سانچہ کے ذیلی صفحات۔ |