WoW API < strtrim

Trim characters (chars), off the left and right of str

local newstr = strtrim(str[, chars])

Arguments[edit | edit source]

(str[, chars])
String - The input string.
String - A list of characters to remove from the left and right of str.
If left off, it defaults to " \t\r\n" ([space][tab][return][newline]).
If adding this argument, please note that spaces will not be trimmed unless you include one with the other characters ("123" is not the same as " 123").

Returns[edit | edit source]

String - The modified string.

Example[edit | edit source]

str = "///All debug and no play, make Eric go crazy.\n\n"
a = strtrim(str, "/\n");


All debug and no play, make Eric go crazy.
Community content is available under CC-BY-SA unless otherwise noted.