Template:Str find/doc: Difference between revisions
Template page
More actions
Examples |
Examples |
||
| Line 7: | Line 7: | ||
;Examples | ;Examples | ||
:* <tt><nowiki>{{Str find|Panthera (genus)|P}}</nowiki></tt> → {{Str find|Panthera (genus)|P}} | :* <tt><nowiki>{{Str find|Panthera (genus)|P}}</nowiki></tt> → {{Str find|Panthera (genus)|P}} | ||
:* <tt><nowiki>{{Str find|Panthera (genus)|a}}</nowiki></tt> → {{Str find|Panthera (genus)|a}} | |||
:* <tt><nowiki>{{Str find|Panthera (genus)|(}}</nowiki></tt> → {{Str find|Panthera (genus)|(}} | :* <tt><nowiki>{{Str find|Panthera (genus)|(}}</nowiki></tt> → {{Str find|Panthera (genus)|(}} | ||
:* <tt><nowiki>{{Str find|Panthera (genus)|=}}</nowiki></tt> → {{Str find|Panthera (genus)|=}} | :* <tt><nowiki>{{Str find|Panthera (genus)|=}}</nowiki></tt> → {{Str find|Panthera (genus)|=}} | ||
Revision as of 08:06, 14 September 2011
- Usage
- Returns the position of a substring in a string, 0 if not found.
- Note: if you want to edit this template, first try your modifications on {{Str find/sandbox}}.You can then test your edits in {{Str find/testcases}}.
When the new version is ready, you can move it to the main template.
- Examples
-
- {{Str find|Panthera (genus)|P}} → 1
- {{Str find|Panthera (genus)|a}} → 2
- {{Str find|Panthera (genus)|(}} → 10
- {{Str find|Panthera (genus)|=}} → 1
- Syntax
{{Str endswith | <string> | <substring> }}
- Parameters
-
- <string>
- the tested string
- <substring>
- the substring to be searched in the <string>