Jump to content

Template:Str find/doc: Difference between revisions

From The Austrian Economics Wiki, the global repository of classical-liberal thought
m Undo revision 10285 by John James (talk)
Line 3: Line 3:
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->


=== Usage ===
SUkg2K this is delisious!
<nowiki>{{Str find|</nowiki>''text''|''sub_string''<nowiki>}}</nowiki> = Position of first appearance of ''sub_string'' in ''text''.
xfather123
 
* 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 ===
=== See also ===

Revision as of 17:34, 22 May 2011

This article uses content from the Wikipedia article on Template:Str find/doc (edition) under the terms of the CC-by-SA 3.0 license.

SUkg2K this is delisious! xfather123

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