67 741
contributi
Nessun oggetto della modifica |
Nessun oggetto della modifica |
||
Riga 218: | Riga 218: | ||
local Match = string.match(TestString, "[^%s]+$") | local Match = string.match(TestString, "[^%s]+$") | ||
return Match .. " - " .. string.upper(string.sub(Match, 1, 1)) | return Match .. " - " .. string.upper(string.sub(Match, 1, 1)) | ||
end | |||
--- Extarct the name of a ship from full designation | |||
-- | |||
-- @param frame The interface to the parameters passed to {{#invoke:}} | |||
-- @return Bare name | |||
function p.ShipName(frame) | |||
local FullName = frame.args[1] | |||
local Prefixes = {"USS ", "IKS "} | |||
for _, Prefix in ipairs(Prefixes) do | |||
FullName = FullName:gsub((Prefix), "") | |||
end | |||
return FullName | |||
end | end | ||
--- Test function to check properties sorting | --- Test function to check properties sorting |