Template:Str find
From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history
1
- Usage
- Returns the position (1 for the first character) of first appearance of substring in a text, -1 if not found.
- Examples
-
- {{Str find|Panthera (genus)|P}} → 1 (first character)
- {{Str find|Panthera (genus)|a}} → 2 (second character)
- {{Str find|Panthera (genus)|(}} → 10
- {{Str find|Panthera (genus)|/}} → -1 (means not found)
- {{Str find|Panthera (genus)|}} → 1 (Warning: empty substring returns 1)
- Syntax
{{Str find | <text> | <substring> }}
- Parameters
-
- <text>
- the tested string
- <substring>
- See also
-
{{Str find/logic}}
a subtemplate
The above documentation is transcluded from Template:Str find/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |