Content deleted Content added
mNo edit summary |
→Usage: mw.ustring.char (where no params are strings) |
||
Line 25:
{{#invoke:Ustring|gsub|1234|23|}}
==Example using mw.ustring.char==
<code><nowiki>&#{{#invoke:ustring|char|49|48|59}}</nowiki></code>
produces:
&#{{#invoke:ustring|char|49|48|59}}
This is nice for escaping character sequences in other modules; for example:
<syntaxhighlight lang="lua">
p = {}
function p.main(frame)
local str = '1-2-2{{#invoke:ustring|char|45}}1-3'
return frame:preprocess(str:gsub('-', '/'))-- == '1/2/2-1/3'
end
return p
</syntaxhighlight>
===Example using mw.ustring.match===
Line 35 ⟶ 51:
===Example using tag arguments===
<pre>{{#invoke:Ustring|sub|{{Module:Ustring}}|274|548
|tag=
produces:
{{#invoke:Ustring|sub|{{Module:Ustring}}|274|548
|tag=syntaxhighlight|lang=lua}}
Note that:
{{#tag:pre|<nowiki><
produces:
<
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
|