ماڈیول:Year

آزاد دائرۃ المعارف، ویکیپیڈیا سے

The module “Year” contains 1 available call that extracts the first-mentioned year (assuming it is between 1000 and 9999) from some text.

استعمال[ترمیم]

{{#invoke:Year|extract|…}}

پیرامیٹرز[ترمیم]

  • The only parameter is the text to extract the year from.

مثال[ترمیم]

en:Module_talk:Year/testcases

local p = {}
function p.extract(frame)
    s = frame.args[1]
    year = "%d%d%d%d"
    return string.sub(s, string.find(s, year))
end
return p