WowAddons

World of Warcraft Forever API · string.md, for your AI

string

6 functions, as Blizzard documents them for Forever 1.60.1 (70959).

Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.

Functions

string.ltrim

trimmed = string.ltrim(str, [characters])

Returns a string with all bytes in the specified character set removed from the start.

Arguments

strstringViewThe string to trim.
charactersstringView default " \\r\\n\\t"The set of bytes to remove.

Returns

trimmedstringViewThe left-trimmed string.

string.rtrim

trimmed = string.rtrim(str, [characters])

Returns a string with all bytes in the specified character set removed from the end.

Arguments

strstringViewThe string to trim.
charactersstringView default " \\r\\n\\t"The set of bytes to remove.

Returns

trimmedstringViewThe right-trimmed string.

string.contains

contains = string.contains(str, substring)

Returns true if a string contains the specified literal substring.

Arguments

strstringViewThe string to search.
substringstringViewThe literal substring for which to search.

Returns

containsboolTrue if the string contains the specified substring; otherwise false.

string.endswith

endsWith = string.endswith(str, suffix)

Returns true if a string ends with the specified suffix.

Arguments

strstringViewThe string to inspect.
suffixstringViewThe suffix for which to search.

Returns

endsWithboolTrue if the string ends with the specified suffix; otherwise false.

string.startswith

startsWith = string.startswith(str, prefix)

Returns true if a string starts with the specified prefix.

Arguments

strstringViewThe string to inspect.
prefixstringViewThe prefix for which to search.

Returns

startsWithboolTrue if the string starts with the specified prefix; otherwise false.

string.trim

trimmed = string.trim(str, [characters])

Returns a string with all bytes in the specified character set removed from both ends.

Arguments

strstringViewThe string to trim.
charactersstringView default " \\r\\n\\t"The set of bytes to remove.

Returns

trimmedstringViewThe trimmed string.

It takes WowAddons

Free, for Windows, macOS and Linux: it puts the addon in your game in one click and keeps it up to date. Open it once, then press Install again.

WowAddons runs on your computer: open wowaddons.gg there.

Download for Windows