Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Implementation edit is for fixing errors and enhancing with metadata.

Instead of changing the code of the snippet, consider creating another Lua implementation.

Other implementations
import "strings"
b := strings.HasSuffix(s, suffix)
var b = s.endsWith(suffix);
$b = $suffix eq substr($s, -length($suffix));
b = s.endswith(suffix)
import std.algorithm.searching;
b = s.endsWith(suffix);
boolean b = s.endsWith(suffix);
uses strutils;
b := AnsiEndsStr(suffix, s);
import Data.Text
b = isSuffixOf suffix s
$b = (bool)preg_match("/{$suffix}$/", $s);
b = s.end_with?(suffix)
String.ends_with?(s, suffix)
let b = s.ends_with(suffix);
var b = s.endsWith(suffix);
val b = s.endsWith(suffix)
bool b = s.EndsWith(suffix);
var _b = _s.EndsWith(_suffix);
return suffix.size() == s.size() - s.rfind(suffix);
  b = (s(len(s)-len(suffix)+1:) == suffix)
(require '[clojure.string :as str])
(let [b (str/ends-with? s suffix)]
   ; ...