Template:Str find/doc

From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history
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>
the substring to be searched in the <text>
Ambox warning pn.svg if <substring> is empty, this template returns 1
Ambox warning pn.svg you cannot search for = as it is interpreted as a parameter separator
See also