模組:沙盒/Lt2818/test

维基百科,自由的百科全书
文档图示 模块文档[创建]
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