mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-27 17:43:53 +01:00
polyfill str_starts: make less dense and mroe readable
This commit is contained in:
parent
2f18e9d4ab
commit
8bc2e543da
@ -22,8 +22,8 @@ end
|
|||||||
-- @param str string The string to operate on
|
-- @param str string The string to operate on
|
||||||
-- @param start number The start string to look for
|
-- @param start number The start string to look for
|
||||||
-- @returns bool Whether start is present at the beginning of str
|
-- @returns bool Whether start is present at the beginning of str
|
||||||
function worldeditadditions.str_starts(str,start)
|
function worldeditadditions.str_starts(str, start)
|
||||||
return string.sub(str,1,string.len(start))==start
|
return string.sub(str, 1, string.len(start)) == start
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Trims whitespace from a string from the beginning and the end.
|
--- Trims whitespace from a string from the beginning and the end.
|
||||||
|
Loading…
Reference in New Issue
Block a user