模組:沙盒/Lt2818/test
模块文档[创建]
您可能想要创建本Scribunto模块的文档。 编者可以在本模块的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模块的子页面。 |
local p = {}
function p.hello(s)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
local tmp = getArgs(s)
return "− " .. tmp.m
end
function p.cannotoutputminussign()
return 0-2 --製造出一個負數,你無法讓他輸出成−
end
function p.MinusSignReplace(str)
local input_str = str
if type(str) == type({"table"}) then
input_str = (str.args or {})[1] or str[1] or ''
elseif type(str) ~= type("string") then
input_str = tostring(str)
end
local body = mw.ustring.gsub(input_str,'%-','−')
return body
end
return p