Template:Str mid and Template:Str mid/sandbox: Difference between pages
From Chalo Chatu, Zambia online encyclopedia
(Difference between pages)
Chalochatu (talk | contribs) (Created page with "{{str mid/core | s={{{1|}}} | i={{#if:{{{2|}}}}|{{{2|}}}|{{#ifexpr:({{#if:{{{3|}}}|1|0}} and {{#if:{{{4|}}}|1|0}})|{{#expr:{{min|{{{4|}}}|{{#invoke:String|len|{{trim|{{{1|}}}}...") |
Chalochatu (talk | contribs) (Created page with "{{str mid/core | s={{{1|}}} | i={{#if:{{{i|{{{2|}}}}}}|{{{i|{{{2|}}}}}}|{{#ifexpr:({{#if:{{{3|}}}|1|0}} and {{#if:{{{j|{{{4|}}}}}}|1|0}})|{{#expr:{{{j|{{{4|}}}}}}-{{{3|}}}+{{#...") |
||
Line 1: | Line 1: | ||
{{str mid/core | {{str mid/core | ||
| s={{{1|}}} | | s={{{1|}}} | ||
| i={{#if:{{{2|}}}}|{{{2|}}}|{{#ifexpr:({{#if:{{{3|}}}|1|0}} and {{#if:{{{4|}}}|1|0}})|{{#expr:{{ | | i={{#if:{{{i|{{{2|}}}}}}|{{{i|{{{2|}}}}}}|{{#ifexpr:({{#if:{{{3|}}}|1|0}} and {{#if:{{{j|{{{4|}}}}}}|1|0}})|{{#expr:{{{j|{{{4|}}}}}}-{{{3|}}}+{{#ifexpr:{{{3|}}}<0|-1|1}}}}|1}}}} | ||
| j= | | j={{#if:{{{j|{{{4|}}}}}}|{{{j|{{{4|}}}}}}|{{#if:{{{3|}}}|{{#expr:{{#if:{{{i|{{{2|}}}}}}|{{{i|{{{2|}}}}}}|1}}+{{{3|}}}+{{#ifexpr:{{{3|}}}<0|1|-1}}}}|{{#invoke:String|len|{{trim|{{{1|}}}}}}}}}}} | ||
| slen={{#invoke:String|len|{{trim|{{{1|}}}}}}} | | slen={{#invoke:String|len|{{trim|{{{1|}}}}}}} | ||
| sublen={{formatnum:{{{3|}}}}} | | sublen={{formatnum:{{{3|}}}}} | ||
| invert={{#ifexpr:{{formatnum:{{#ifeq:{{{3|}}}||0|{{{3|}}}}}}}<0|yes|no}} | | invert={{#ifexpr:{{formatnum:{{#ifeq:{{{3|}}}||0|{{{3|}}}}}}}<0|yes|no}} | ||
| triangle check={{#if:{{{2|}}}|{{#if:{{{3|}}}|{{#if:{{{4|}}}|{{#ifexpr:(({{{4|}}}-{{{2|0}}}+1)<>{{{3|0}}}) and ({{{2|}}}*{{{4|}}}<>0)|Error using {{tl|Str mid}}: indexes i={{{2|}}} and j={{{4|}}} do not match requested substring length | | triangle check={{#if:{{{i|{{{2|}}}}}}|{{#if:{{{3|}}}|{{#if:{{{j|{{{4|}}}}}}|{{#ifexpr:(({{{j|{{{4|0}}}}}}-{{{i|{{{2|0}}}}}}+1)<>{{{3|0}}}) and ({{{i|{{{2|}}}}}}*{{{j|{{{4|}}}}}}<>0)|Error using {{tl|Str mid}}: indexes i={{{i|{{{2|}}}}}} and j={{{j|{{{4|}}}}}} do not match requested substring length {{{3|}}}}}|<!-- triangle checked, is OK -->}}}}}} | ||
|ignore_errors={{{ignore errors|false}}} | |ignore_errors={{{ignore errors|false}}} | ||
|error_category={{yesno|{{{error category|}}}|yes={{{error category|}}}}} | |error_category={{yesno|{{{error category|}}}|yes={{{error category|}}}}} | ||
|no_category={{{no category|false}}} | |no_category={{{no category|false}}}}}<noinclude> | ||
}}<noinclude> | |||
* {{tl|Str mid/core}} | * {{tl|Str mid/core}} | ||
* {{tl|Str mid/testcases}} | * {{tl|Str mid/testcases}} | ||
</noinclude> | </noinclude> |