Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Str rightc

Permanently protected module
From Wikipedia, the free encyclopedia

require[[strict]]
local p = {}

function p._rightc(str, count, empty)
	str = mw.text.trim(str or '')
	if '' == str then
		return mw.text.trim(empty or '')
	end
	count = tonumber(count or '')
	if nil == count then
		return str
	end
	if count <= 0 then
		return ''
	end
	return mw.ustring.sub(str, -count)
end

function p.rightc(frame)
	local args = frame.args
	if '' == (args.notemplate or '') then
		args = frame:getParent().args
	end
	return p._rightc(args[1], args[2], args[3])
end

return p