Module:String2: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Prune code duplication
(function ucfirst) |
(Prune code duplication) |
||
Line 90:
return table.concat(words, " ")
end
p.label = p.ucfirst
▲ -- Capitalizing only first letter for fetched Wikidata labels.
▲ -- Wikidata English labels generally begin with a lowercase letter. [[:d:Help:Label#Capitalization]]
-- stripZeros finds the first number and strips leading zeros (apart from units)
-- e.g "0940" -> "940"; "Year: 0023" -> "Year: 23"; "00.12" -> "0.12"
Line 126 ⟶ 108:
return mw.text.nowiki(str)
end
return p
|