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.
 
 
 
 
 
 

24 lines
477 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>
example: |
const char *buf;
buf = duk_require_string(ctx, -3);
printf("value is a string: %s\n", buf);
tags:
- stack
- string
introduced: 1.0.0