Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

JS_GetStringLength

Return the length, in 16-bit code units, of a JavaScript string.

Syntax

size_t
JS_GetStringLength(JSString *str);
Name Type Description
str JSString * The string to examine.

Description

JS_GetStringLength reports the length, in 16-bit code units, of the string str. This is the same as the length property of the string. This is the same as the length of the array returned by JS_GetStringChars, in char16_ts (not bytes).

Because some Unicode characters are represented using two 16-bit code units, the result is not necessarily the same as the number of Unicode characters in the string.

See Also

Document Tags and Contributors

 Contributors to this page: arai, fscholz, Jorend, Waldo, Bzbarsky, Nickolay, MMondor, Tservo
 Last updated by: arai,