Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Str find/doc: Difference between revisions

Template page
Usage
interwiki
Line 2: Line 2:


;Usage
;Usage
: Returns the position (1 for the first character) of a ''substring'' in a ''string'', 1 if not found.
: Returns the position (1 for the first character) of first appearance of ''substring'' in a ''text'', 1 if not found.
: {{SandboxDocumentation}}
: {{SandboxDocumentation}}


Line 12: Line 12:


;Syntax
;Syntax
: <pre><nowiki>{{Str endswith | <string> | <substring> }}</nowiki></pre>
: <pre><nowiki>{{Str endswith | <text> | <substring> }}</nowiki></pre>


;Parameters
;Parameters
:* '''<string>'''
:* '''<text>'''
:: the tested string
:: the tested string
:* '''<substring>'''
:* '''<substring>'''
:: the substring to be searched in the <string>
:: the substring to be searched in the <text>


<includeonly>
<includeonly>


[[Category:String manipulation templates]]
[[Category:String manipulation templates]]
[[ar:قالب:Str find]]
[[de:Vorlage:Str find]]
[[en:Template:Str find]]
[[eo:Ŝablono:Lin serĉi]]
[[es:Plantilla:Str find]]
[[hsb:Předłoha:Str find]]
[[id:Templat:Str find]]
[[it:Template:Str find]]
[[ja:Template:Str find]]
[[ur:Template:Str find]]


</includeonly>
</includeonly>

Revision as of 08:11, 14 September 2011

Usage
Returns the position (1 for the first character) of first appearance of substring in a text, 1 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 | <text> | <substring> }}
Parameters
  • <text>
the tested string
  • <substring>
the substring to be searched in the <text>


Cookies help us deliver our services. By using our services, you agree to our use of cookies.