Skip to content

Commit

Permalink
string: use ~= instead of == check for endswith
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilal2453 authored and truemedian committed Nov 1, 2022
1 parent 01832a5 commit 9095ea3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/string.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function ext_string.endswith(str, pattern, plain)
if plain then
return string.sub(str, - #pattern) == pattern
else
if string.sub(pattern, -1) == '$' then
if string.sub(pattern, -1) ~= '$' then
pattern = pattern .. '$'
end

Expand Down

0 comments on commit 9095ea3

Please sign in to comment.