Template:Str find/doc: Difference between revisions
Appearance
John James (talk | contribs) Created page with "{{Documentation subpage}} {{Wikipedia text|Template:Str find/doc|420076927}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> === Usage === <nowiki>{{Str..." |
John James (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
{{Wikipedia text|Template: | {{Wikipedia text|Template:TOC right/doc|426733575}} | ||
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | ||
Revision as of 10:13, 6 May 2011
| This is a documentation subpage for Template:Str find. It contains usage information, categories and other content that is not part of the original template page. |
- This article uses content from the Wikipedia article on Template:TOC right/doc (edition) under the terms of the CC-by-SA 3.0 license.
Usage
{{Str find|text|sub_string}} = Position of first appearance of sub_string in text.
- Only searches first 50 characters of text. Returns -1 if sub_string not found in first 80 characters.
- Character position is 1 based (not 0 based as usual in calculations).
- Warning: if sub_string is empty, then this routine will return 1 !!! This case will often have to be handled specially.
See also
Template:Strfind short can handle longer strings (<99 chars), and gives far better performance, especially for short strings.
Description of all string templates