comparison xml/en/docs/njs/reference.xml @ 2271:34a1901e663d

Described charAt, codePointAt, fromCharCode in njs.
author Yaroslav Zhuravlev <yar@nginx.com>
date Wed, 31 Oct 2018 20:56:02 +0300
parents cd1b26111884
children e58e7b2eff51
comparison
equal deleted inserted replaced
2270:cd9934924920 2271:34a1901e663d
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd">
8 8
9 <article name="Reference" 9 <article name="Reference"
10 link="/en/docs/njs/reference.html" 10 link="/en/docs/njs/reference.html"
11 lang="en" 11 lang="en"
12 rev="14"> 12 rev="15">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 <link doc="index.xml">njs</link> provides objects, methods and properties 17 <link doc="index.xml">njs</link> provides objects, methods and properties
522 >> String.bytesFrom('YnVmZmVy', 'base64') 522 >> String.bytesFrom('YnVmZmVy', 'base64')
523 'buffer' 523 'buffer'
524 </example> 524 </example>
525 </tag-desc> 525 </tag-desc>
526 526
527 <tag-name id="string_fromcharcode"><literal>String.fromCharCode(<value>CharCode1</value>[, ...[,
528 <value>CharCodeN</value>]])</literal></tag-name>
529 <tag-desc>
530 Returns a string from one or more Unicode code points.
531 <example>
532 >> String.fromCharCode(97, 98, 99, 100)
533 'abcd'
534 </example>
535 </tag-desc>
536
527 <tag-name id="string_fromcodepoint"><literal>String.fromCodePoint(<value>codePoint1</value>[, ...[, 537 <tag-name id="string_fromcodepoint"><literal>String.fromCodePoint(<value>codePoint1</value>[, ...[,
528 <value>codePoint2</value>]])</literal></tag-name> 538 <value>codePoint2</value>]])</literal></tag-name>
529 <tag-desc> 539 <tag-desc>
530 Returns a string from one or more Unicode code points. 540 Returns a string from one or more Unicode code points.
531 <example> 541 <example>
532 >> String.fromCodePoint(97, 98, 99, 100) 542 >> String.fromCodePoint(97, 98, 99, 100)
533 'abcd' 543 'abcd'
544 </example>
545 </tag-desc>
546
547 <tag-name id="string_charat"><literal>String.prototype.charAt(<value>index</value>)</literal></tag-name>
548 <tag-desc>
549 Returns a string representing one Unicode code unit
550 at the specified <literal>index</literal>;
551 empty string if index is out of range.
552 The <literal>index</literal> can be integer
553 between 0 and 1-less-than the length of the string.
554 If no index is provided, the default is <literal>0</literal>,
555 so the first character in the string is returned.
556 </tag-desc>
557
558 <tag-name id="string_codepointat"><literal>String.prototype.CodePointAt(<value>position</value>)</literal></tag-name>
559 <tag-desc>
560 Returns a number representing the code point value of the character
561 at the given index;
562 <literal>undefined</literal> if there is no element at position.
563 <example>
564 >> 'ABCD'.codePointAt(3);
565 68
534 </example> 566 </example>
535 </tag-desc> 567 </tag-desc>
536 568
537 <tag-name id="string_concat"><literal>String.prototype.concat(<value>string1</value>[, ..., 569 <tag-name id="string_concat"><literal>String.prototype.concat(<value>string1</value>[, ...,
538 <value>stringN</value>])</literal></tag-name> 570 <value>stringN</value>])</literal></tag-name>