mirror of https://github.com/svaarala/duktape.git
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.
22 lines
686 B
22 lines
686 B
name: duk_char_code_at
|
|
|
|
proto: |
|
|
duk_codepoint_t duk_char_code_at(duk_context *ctx, duk_idx_t idx, duk_size_t char_offset);
|
|
|
|
stack: |
|
|
[ ... str! ... ]
|
|
|
|
summary: |
|
|
<p>Get the codepoint of a character at character offset <code>char_offset</code>
|
|
of a string at <code>idx</code>. If the value at <code>idx</code> is not
|
|
a string, an error is thrown. If the string cannot be (extended) UTF-8 decoded,
|
|
the result is U+FFFD (Unicode replacement character). If <code>char_offset</code>
|
|
is invalid (outside the string) a zero is returned.</p>
|
|
|
|
example: |
|
|
printf("char code at char index 12: %ld\n", (long) duk_char_code_at(ctx, -3, 12));
|
|
|
|
tags:
|
|
- string
|
|
|
|
introduced: 1.0.0
|
|
|