Module:Params/doc: Difference between revisions

Content deleted Content added
mNo edit summary
trimmed: Update doc
Line 288:
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|trimmed|left trim|right trim|pipe function name}}</syntaxhighlight>
 
The first argument indicates how many sequential parameters must be removed from the beginning of the parameter list, the second argument indicates how many sequential parameters must be removed from the end of the parameter list. BothIf any of the two arguments canis a negative number its absolute value indicates what must be eitherleft zero''on orthe positiveother side'' – i.e. <syntaxhighlight lang="wikitext" inline>{{#invoke:params|trimmed|-3|0|list}}</syntaxhighlight> indicates that the last three arguments must be integerslisted.
 
Example:
 
<syntaxhighlight lang="wikitext">{{#invoke:params|trimmed|0|2|sequential|call_for_each_value|example template}}</syntaxhighlight>
 
{{A note}} Although <syntaxhighlight lang="wikitext" inline>{{#invoke:params|trimmed|-1|1|...}}</syntaxhighlight> de facto gets rid of all sequential arguments, it is more efficient to do <syntaxhighlight lang="wikitext" inline>{{#invoke:params|non-sequential|...}}</syntaxhighlight> to obtain the same effect.
 
{{vpad}}