string.starts_with

Returns whether a string starts with a specifics substring.

Usage

string.starts_with(prefix)

Arguments

Name Type Description
prefix string Prefix to check against.

Returns

Name Type Description
result boolean True if the string starts with prefix, false otherwise.

Examples

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

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