=proto void duk_trim(duk_context *ctx, int index); =stack [ ... str! ... ] -> [ ... trimmed_str! ... ] =summary

Trim string at index. If the value at index is not a string or the index is invalid, throws an error.

Trimming removes white space characters from the beginning and end the end of the string. The result is an empty string if the string consists entirely of white space characters. The set of characters considered to be white space is defined by the StrWhiteSpace production, which contains both WhiteSpace and LineTerminator characters. The trimming behavior matches those of String.prototype.trim(), parseInt(), and parseFloat().

=example duk_trim(ctx, -3); =tags stack string =fixme Return const char *?