Jump to content

Module:Sandbox/Deimos18/Names

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Deimos18 (talk | contribs) at 21:24, 21 November 2018. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- Deimos Google Code-in, Names of people

local p = {}

p.getnames = function (frame)
	local name = string.sub(frame.args.name,1,string.len(name)) or ""
	local format = format or ""
	local revname = string.reverse(name)
	local l_name = string.reverse(string.match(revname, "(%a+)")) or ""
	local f_name = string.gsub(name, l_name, "", 1) or ""
	return "Given Name: " .. f_name .. " Family Name: " .. l_name
end

return p