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
str | stringView | The string to trim. |
|---|---|---|
characters | stringView default " \\r\\n\\t" | The set of bytes to remove. |
Returns
trimmed | stringView | The 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
str | stringView | The string to trim. |
|---|---|---|
characters | stringView default " \\r\\n\\t" | The set of bytes to remove. |
Returns
trimmed | stringView | The right-trimmed string. |
|---|
string.contains
contains = string.contains(str, substring)
Returns true if a string contains the specified literal substring.
Arguments
str | stringView | The string to search. |
|---|---|---|
substring | stringView | The literal substring for which to search. |
Returns
contains | bool | True 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
str | stringView | The string to inspect. |
|---|---|---|
suffix | stringView | The suffix for which to search. |
Returns
endsWith | bool | True 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
str | stringView | The string to inspect. |
|---|---|---|
prefix | stringView | The prefix for which to search. |
Returns
startsWith | bool | True 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
str | stringView | The string to trim. |
|---|---|---|
characters | stringView default " \\r\\n\\t" | The set of bytes to remove. |
Returns
trimmed | stringView | The trimmed string. |
|---|