Difference between revisions of "Template:Str sub old"
From Ava Zinn Wiki
[unchecked revision] | [unchecked revision] |
(documentation subpage) |
(fix) |
||
Line 1: | Line 1: | ||
<includeonly>{{#ifeq:{{{2|0}}}|0|{{str_left|{{{1}}}|{{{3|0}}}}}|<!-- | <includeonly>{{#ifeq:{{{2|0}}}|0|{{str_left|{{{1}}}|{{{3|0}}}}}|<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 1 and {{{2|0}}} + {{{3|0}}} >= 1|<!-- |
-->{{str_index|{{{1}}}|1}}}}<!-- | -->{{str_index|{{{1}}}|1}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 2 and {{{2|0}}} + {{{3|0}}} >= 2|<!-- |
-->{{str_index|{{{1}}}|2}}}}<!-- | -->{{str_index|{{{1}}}|2}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 3 and {{{2|0}}} + {{{3|0}}} >= 3|<!-- |
-->{{str_index|{{{1}}}|3}}}}<!-- | -->{{str_index|{{{1}}}|3}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 4 and {{{2|0}}} + {{{3|0}}} >= 4|<!-- |
-->{{str_index|{{{1}}}|4}}}}<!-- | -->{{str_index|{{{1}}}|4}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 5 and {{{2|0}}} + {{{3|0}}} >= 5|<!-- |
-->{{str_index|{{{1}}}|5}}}}<!-- | -->{{str_index|{{{1}}}|5}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 6 and {{{2|0}}} + {{{3|0}}} >= 6|<!-- |
-->{{str_index|{{{1}}}|6}}}}<!-- | -->{{str_index|{{{1}}}|6}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 7 and {{{2|0}}} + {{{3|0}}} >= 7|<!-- |
-->{{str_index|{{{1}}}|7}}}}<!-- | -->{{str_index|{{{1}}}|7}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 8 and {{{2|0}}} + {{{3|0}}} >= 8|<!-- |
-->{{str_index|{{{1}}}|8}}}}<!-- | -->{{str_index|{{{1}}}|8}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 9 and {{{2|0}}} + {{{3|0}}} >= 9|<!-- |
-->{{str_index|{{{1}}}|9}}}}<!-- | -->{{str_index|{{{1}}}|9}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 10 and {{{2|0}}} + {{{3|0}}} >= 10|<!-- |
-->{{str_index|{{{1}}}|10}}}}<!-- | -->{{str_index|{{{1}}}|10}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 11 and {{{2|0}}} + {{{3|0}}} >= 11|<!-- |
-->{{str_index|{{{1}}}|11}}}}<!-- | -->{{str_index|{{{1}}}|11}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 12 and {{{2|0}}} + {{{3|0}}} >= 12|<!-- |
-->{{str_index|{{{1}}}|12}}}}<!-- | -->{{str_index|{{{1}}}|12}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 13 and {{{2|0}}} + {{{3|0}}} >= 13|<!-- |
-->{{str_index|{{{1}}}|13}}}}<!-- | -->{{str_index|{{{1}}}|13}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 14 and {{{2|0}}} + {{{3|0}}} >= 14|<!-- |
-->{{str_index|{{{1}}}|14}}}}<!-- | -->{{str_index|{{{1}}}|14}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 15 and {{{2|0}}} + {{{3|0}}} >= 15|<!-- |
-->{{str_index|{{{1}}}|15}}}}<!-- | -->{{str_index|{{{1}}}|15}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 16 and {{{2|0}}} + {{{3|0}}} >= 16|<!-- |
-->{{str_index|{{{1}}}|16}}}}<!-- | -->{{str_index|{{{1}}}|16}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 17 and {{{2|0}}} + {{{3|0}}} >= 17|<!-- |
-->{{str_index|{{{1}}}|17}}}}<!-- | -->{{str_index|{{{1}}}|17}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 18 and {{{2|0}}} + {{{3|0}}} >= 18|<!-- |
-->{{str_index|{{{1}}}|18}}}}<!-- | -->{{str_index|{{{1}}}|18}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 19 and {{{2|0}}} + {{{3|0}}} >= 19|<!-- |
-->{{str_index|{{{1}}}|19}}}}<!-- | -->{{str_index|{{{1}}}|19}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 20 and {{{2|0}}} + {{{3|0}}} >= 20|<!-- |
-->{{str_index|{{{1}}}|20}}}}<!-- | -->{{str_index|{{{1}}}|20}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 21 and {{{2|0}}} + {{{3|0}}} >= 21|<!-- |
-->{{str_index|{{{1}}}|21}}}}<!-- | -->{{str_index|{{{1}}}|21}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 22 and {{{2|0}}} + {{{3|0}}} >= 22|<!-- |
-->{{str_index|{{{1}}}|22}}}}<!-- | -->{{str_index|{{{1}}}|22}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 23 and {{{2|0}}} + {{{3|0}}} >= 23|<!-- |
-->{{str_index|{{{1}}}|23}}}}<!-- | -->{{str_index|{{{1}}}|23}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 24 and {{{2|0}}} + {{{3|0}}} >= 24|<!-- |
-->{{str_index|{{{1}}}|24}}}}<!-- | -->{{str_index|{{{1}}}|24}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 25 and {{{2|0}}} + {{{3|0}}} >= 25|<!-- |
-->{{str_index|{{{1}}}|25}}}}<!-- | -->{{str_index|{{{1}}}|25}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 26 and {{{2|0}}} + {{{3|0}}} >= 26|<!-- |
-->{{str_index|{{{1}}}|26}}}}<!-- | -->{{str_index|{{{1}}}|26}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 27 and {{{2|0}}} + {{{3|0}}} >= 27|<!-- |
-->{{str_index|{{{1}}}|27}}}}<!-- | -->{{str_index|{{{1}}}|27}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 28 and {{{2|0}}} + {{{3|0}}} >= 28|<!-- |
-->{{str_index|{{{1}}}|28}}}}<!-- | -->{{str_index|{{{1}}}|28}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 29 and {{{2|0}}} + {{{3|0}}} >= 29|<!-- |
-->{{str_index|{{{1}}}|29}}}}<!-- | -->{{str_index|{{{1}}}|29}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 30 and {{{2|0}}} + {{{3|0}}} >= 30|<!-- |
-->{{str_index|{{{1}}}|30}}}}<!-- | -->{{str_index|{{{1}}}|30}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 31 and {{{2|0}}} + {{{3|0}}} >= 31|<!-- |
-->{{str_index|{{{1}}}|31}}}}<!-- | -->{{str_index|{{{1}}}|31}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 32 and {{{2|0}}} + {{{3|0}}} >= 32|<!-- |
-->{{str_index|{{{1}}}|32}}}}<!-- | -->{{str_index|{{{1}}}|32}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 33 and {{{2|0}}} + {{{3|0}}} >= 33|<!-- |
-->{{str_index|{{{1}}}|33}}}}<!-- | -->{{str_index|{{{1}}}|33}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 34 and {{{2|0}}} + {{{3|0}}} >= 34|<!-- |
-->{{str_index|{{{1}}}|34}}}}<!-- | -->{{str_index|{{{1}}}|34}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 35 and {{{2|0}}} + {{{3|0}}} >= 35|<!-- |
-->{{str_index|{{{1}}}|35}}}}<!-- | -->{{str_index|{{{1}}}|35}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 36 and {{{2|0}}} + {{{3|0}}} >= 36|<!-- |
-->{{str_index|{{{1}}}|36}}}}<!-- | -->{{str_index|{{{1}}}|36}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 37 and {{{2|0}}} + {{{3|0}}} >= 37|<!-- |
-->{{str_index|{{{1}}}|37}}}}<!-- | -->{{str_index|{{{1}}}|37}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 38 and {{{2|0}}} + {{{3|0}}} >= 38|<!-- |
-->{{str_index|{{{1}}}|38}}}}<!-- | -->{{str_index|{{{1}}}|38}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 39 and {{{2|0}}} + {{{3|0}}} >= 39|<!-- |
-->{{str_index|{{{1}}}|39}}}}<!-- | -->{{str_index|{{{1}}}|39}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 40 and {{{2|0}}} + {{{3|0}}} >= 40|<!-- |
-->{{str_index|{{{1}}}|40}}}}<!-- | -->{{str_index|{{{1}}}|40}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 41 and {{{2|0}}} + {{{3|0}}} >= 41|<!-- |
-->{{str_index|{{{1}}}|41}}}}<!-- | -->{{str_index|{{{1}}}|41}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 42 and {{{2|0}}} + {{{3|0}}} >= 42|<!-- |
-->{{str_index|{{{1}}}|42}}}}<!-- | -->{{str_index|{{{1}}}|42}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 43 and {{{2|0}}} + {{{3|0}}} >= 43|<!-- |
-->{{str_index|{{{1}}}|43}}}}<!-- | -->{{str_index|{{{1}}}|43}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 44 and {{{2|0}}} + {{{3|0}}} >= 44|<!-- |
-->{{str_index|{{{1}}}|44}}}}<!-- | -->{{str_index|{{{1}}}|44}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 45 and {{{2|0}}} + {{{3|0}}} >= 45|<!-- |
-->{{str_index|{{{1}}}|45}}}}<!-- | -->{{str_index|{{{1}}}|45}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 46 and {{{2|0}}} + {{{3|0}}} >= 46|<!-- |
-->{{str_index|{{{1}}}|46}}}}<!-- | -->{{str_index|{{{1}}}|46}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 47 and {{{2|0}}} + {{{3|0}}} >= 47|<!-- |
-->{{str_index|{{{1}}}|47}}}}<!-- | -->{{str_index|{{{1}}}|47}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 48 and {{{2|0}}} + {{{3|0}}} >= 48|<!-- |
-->{{str_index|{{{1}}}|48}}}}<!-- | -->{{str_index|{{{1}}}|48}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 49 and {{{2|0}}} + {{{3|0}}} >= 49|<!-- |
-->{{str_index|{{{1}}}|49}}}}<!-- | -->{{str_index|{{{1}}}|49}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} < | + | -->{{#ifexpr:{{{2|0}}} < 50 and {{{2|0}}} + {{{3|0}}} >= 50|<!-- |
-->{{str_index|{{{1}}}|50}}}}<!-- | -->{{str_index|{{{1}}}|50}}}}<!-- | ||
− | -->{{#ifexpr:{{{2|0}}} > 50 or {{{2|0}}} + {{{3|0}}} > 50|{{FormattingError|max index is 50 for str_sub}}}}<!-- | + | -->{{#ifexpr:{{{2|0}}} >= 50 or {{{2|0}}} + {{{3|0}}} > 50|{{FormattingError|max index is 50 for str_sub}}}}<!-- |
-->}}</includeonly><noinclude> | -->}}</includeonly><noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> |
Revision as of 23:32, 13 June 2009
Usage
{{str_sub|text|start|length}}
= Substring of text starting at start and containing length characters. Base 0: the first character is numbered 0, and so on, e.g. {{str_sub|20090624130510|8|2}} returns the 2 characters starting at the 9th, i.e. "{{safesubst:#invoke:String|sublength|s=20090624130510|i=8|len=2}}"
Template data
This is the TemplateData documentation for this template used by VisualEditor and other tools.
Str sub old
The template takes a substring of ''text'' starting at ''start'' and containing ''length'' characters.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Text | 1 | The substring to be trimmed.
| String | required |
Numeric position | 2 | Numeric position of the starting character within the string
| Number | required |
Count | 3 | Number of characters for the substring
| Number | required |
See also
|
The above documentation is transcluded from Template:Str sub old/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |