From 8bc2e543da014f546be100459d392561d54afb57 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 30 May 2021 13:06:47 +0100 Subject: [PATCH] polyfill str_starts: make less dense and mroe readable --- worldeditadditions/utils/strings/polyfill.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worldeditadditions/utils/strings/polyfill.lua b/worldeditadditions/utils/strings/polyfill.lua index d362353..d08edc3 100644 --- a/worldeditadditions/utils/strings/polyfill.lua +++ b/worldeditadditions/utils/strings/polyfill.lua @@ -22,8 +22,8 @@ end -- @param str string The string to operate on -- @param start number The start string to look for -- @returns bool Whether start is present at the beginning of str -function worldeditadditions.str_starts(str,start) - return string.sub(str,1,string.len(start))==start +function worldeditadditions.str_starts(str, start) + return string.sub(str, 1, string.len(start)) == start end --- Trims whitespace from a string from the beginning and the end.