You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
611 B

name: duk_require_string
proto: |
const char *duk_require_string(duk_context *ctx, duk_idx_t idx);
stack: |
[ ... val! ... ]
summary: |
<p>Like <code><a href="#duk_get_string">duk_get_string()</a></code>,
but throws an error if the value at <code>idx</code> is not a string
or if the index is invalid.</p>
<div include="string-non-null-zero-length.html" />
<div include="symbols-are-strings.html" />
example: |
const char *buf;
buf = duk_require_string(ctx, -3);
printf("value is a string: %s\n", buf);
tags:
- stack
- string
seealso:
- duk_require_lstring
introduced: 1.0.0