Difference between revisions of "Template:Evaldemo/doc"
Jump to navigation
Jump to search
imported>Happy-melon (rm deleted cat) |
|||
| Line 17: | Line 17: | ||
<!-- #:{{subst:evaldemo|uc:Upper Case|subst=subst:}} --> | <!-- #:{{subst:evaldemo|uc:Upper Case|subst=subst:}} --> | ||
#:{{<small> </small><code>subst:uc:Upper Case</code>}} {{{s|gives}}} UPPER CASE | #:{{<small> </small><code>subst:uc:Upper Case</code>}} {{{s|gives}}} UPPER CASE | ||
| − | #:See [[m:Help:Substitution|Help:Substitution]] for several caveats wrt < | + | #:See [[m:Help:Substitution|Help:Substitution]] for several caveats wrt <code>subst=subst:</code>. |
As always the expression (first parameter) cannot directly contain "'''|'''", "'''='''", plus other special cases related to square brackets / curly braces. In the case of this template "not directly" means "never" except from "'''='''" as shown above. | As always the expression (first parameter) cannot directly contain "'''|'''", "'''='''", plus other special cases related to square brackets / curly braces. In the case of this template "not directly" means "never" except from "'''='''" as shown above. | ||
Revision as of 14:43, 24 April 2016
Examples:
{{Evaldemo|CURRENTDAY|s=is}}displays{{CURRENTDAY}}is 9
{{Evaldemo|#expr:2*3}}displays{{#expr:2*3}}gives 6
- {{subst:evaldemo|subst=subst:|#expr:2*3}} gives:
- {{
subst:#expr:2*3}} gives 6
- {{
{{Evaldemo|1=#expr:2+2=5}}displays{{#expr:2+2=5}}gives 0
{{Evaldemo|1=#expr:(2+2=4)|s==}}displays{{#expr:(2+2=4)}}= 1
{{Evaldemo|urlencode:!|s==}}displays{{urlencode:!}}= %21
{{Evaldemo|uc:abc}}gives{{uc:abc}}gives ABC
- {{subst:Evaldemo|uc:Upper Case|subst=subst:}} substitutes
- {{
subst:uc:Upper Case}} gives UPPER CASE - See Help:Substitution for several caveats wrt
subst=subst:.
- {{
As always the expression (first parameter) cannot directly contain "|", "=", plus other special cases related to square brackets / curly braces. In the case of this template "not directly" means "never" except from "=" as shown above.
For simple nested expressions use Template:Evaldemo/2(edit talk links history):
{{evaldemo/2|#expr:4*|#expr:not 0| >3 | s=yields}}displays- {{
#expr: 4*{{#expr:not 0}}>3}} yields 1
- {{
{{evaldemo/2|urlencode:|DIRMARK}}displays- {{
urlencode:{{DIRMARK}}}} gives %E2%80%8E
- {{