Concatenate two JS strings.


JSString *
JS_ConcatStrings(JSContext *cx, JS::HandleString left, JS::HandleString right);
Name Type Description
cx JSContext * The context in which both the strings have been created.
left JS::HandleString First string to concatenate.
right JS::HandleString Second string to concatenate.


JS_ConcatStrings concatenates two JS strings, str1 and str2, and returns the result. The result could be the same as one of the input strings, if the other string is zero length. When the string concatenation fails NULL is returned.

See Also