Module:Case: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
function p.uppercase_first_letter(frame) | function p.uppercase_first_letter(frame) | ||
first_letter = string.sub(frame.args.link, | first_letter = string.sub(frame.args.link, 1, 2) | ||
rest_of_link = string.sub(frame.args.link, 2, string.len(frame.args.link)) | rest_of_link = string.sub(frame.args.link, 2, string.len(frame.args.link)) | ||
return "[[" .. frame.args.link .. "|" .. string.upper(first_letter) .. string.lower(rest_of_link) .. "]]" | return "[[" .. frame.args.link .. "|" .. string.upper(first_letter) .. string.lower(rest_of_link) .. "]]" |
Revision as of 21:21, 22 May 2021
See usage on Script error: The function "title_case" does not exist., TEemplate:u, and template:l.
local p = {} --p stands for package
function p.lowercase(frame)
return "[[" .. frame.args.link .. "|" .. string.lower(frame.args.link) .. "]]"
end
function p.uppercase_first_letter(frame)
first_letter = string.sub(frame.args.link, 1, 2)
rest_of_link = string.sub(frame.args.link, 2, string.len(frame.args.link))
return "[[" .. frame.args.link .. "|" .. string.upper(first_letter) .. string.lower(rest_of_link) .. "]]"
end
return p