Template:Str find
- español
- 日本語
- Deutsch
- français
- 中文
- русский
- italiano
- português
- Nederlands
- العربية
- аԥсшәа
- Alemannisch
- алтай тил
- अंगिका
- مصرى
- asturianu
- авар
- azərbaycanca
- تۆرکجه
- башҡортса
- Basa Bali
- Boarisch
- беларуская
- беларуская (тарашкевіца)
- भोजपुरी
- বাংলা
- 閩東語 / Mìng-dĕ̤ng-ngṳ̄
- нохчийн
- کوردی
- čeština
- чӑвашла
- dansk
- dolnoserbski
- Kadazandusun
- Ελληνικά
- Esperanto
- eesti
- euskara
- فارسی
- føroyskt
- arpetan
- Nordfriisk
- Gaeilge
- galego
- گیلکی
- Gaelg
- Hausa
- 客家語 / Hak-kâ-ngî
- עברית
- हिन्दी
- hornjoserbsce
- magyar
- հայերեն
- Jaku Iban
- Bahasa Indonesia
- Ilokano
- гӀалгӀай
- íslenska
- Jawa
- ქართული
- қазақша
- ភាសាខ្មែរ
- 한국어
- kurdî
- коми
- Lëtzebuergesch
- лакку
- лезги
- Ligure
- latviešu
- मैथिली
- мокшень
- олык марий
- Minangkabau
- монгол
- ဘာသာမန်
- кырык мары
- Bahasa Melayu
- မြန်မာဘာသာ
- эрзянь
- مازِرونی
- Plattdüütsch
- नेपाली
- Li Niha
- occitan
- ଓଡ଼ିଆ
- ирон
- ਪੰਜਾਬੀ
- rumantsch
- română
- tarandíne
- русиньскый
- संस्कृतम्
- саха тыла
- Scots
- တႆး
- Simple English
- slovenčina
- slovenščina
- shqip
- српски / srpski
- ತುಳು
- тоҷикӣ
- ไทย
- ትግርኛ
- Tagalog
- Türkçe
- татарча / tatarça
- удмурт
- українська
- اردو
- oʻzbekcha / ўзбекча
- vèneto
- Tiếng Việt
- 吴语
- ייִדיש
- 文言
- 閩南語 / Bân-lâm-gú
- 粵語
- isiZulu
1
Category:Wikipedia template-protected templates#Str%20find
![]() | This template is used on approximately 295,000 pages. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
![]() | This template uses Lua: |
Usage
{{Str find|text|sub_string}}
Returns the position of first appearance of sub_string in text.
- The comparison is case sensitive.
- Returns -1 if sub_string not found
- Character position is 1 based (not 0 based as usual in calculations).
- If sub_string is empty, this routine returns 1. This case will often have to be handled specially.
Examples
In the examples, the string to be searched is Abcdefghijklm
:
- A; 1
- a; -1
- def; 4
- klm; 11
- zyx; -1
Examples with empty parameters:
- empty;klm; -1
- empty;empty; 1
TemplateData
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Str find in articles based on its TemplateData.
Category:Templates using TemplateData
TemplateData for Str find
A template to find the numeric position of first appearance of ''sub_string'' in ''text''
Parameter | Description | Type | Status | |
---|---|---|---|---|
Text | 1 | The text to search within | String | required |
Sub_string | 2 | The string to be searched within the text | String | required |
See also
String-handling templates (help page) | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
The above documentation is transcluded from Template:Str find/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.