Module:String2: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(update from Module:String2/sandbox: tweaks + findpagetext won't fail if given an invalid or nonexistent page title) |
(Add startswith, analogous to endswith) |
||
Line 350: | Line 350: | ||
return p.hyphen_to_dash(str, spacing) |
return p.hyphen_to_dash(str, spacing) |
||
end |
|||
-- Similar to [[Module:String#endswith]] |
|||
function p.startswith(frame) |
|||
return (frame.args[1]:sub(1, frame.args[2]:len()) == frame.args[2]) and 'yes' or '' |
|||
end |
end |
||