string.ends_with

Returns whether a string ends with a specifics substring.

Usage

string.ends_with(suffix)

Arguments

Name Type Description
suffix string suffix to check against.

Returns

Name Type Description
result boolean True if the string ends with suffix, false otherwise.

Examples

local text = "dark sword";
print(text:ends_with("sword")); -- Prints "true"
local text = "dark sword";
print(text:ends_with("f")); -- Prints "false"

This site uses Just the Docs, a documentation theme for Jekyll.