Unicode strings: Difference between revisions

Content added Content deleted
Line 799: Line 799:
For clarity, identifiers are ASCII only.
For clarity, identifiers are ASCII only.


Indexing on a string indexes by code point. The index may be a single number, a range, or an array of such things. Indexing returns another string.
Indexing on a string indexes by code point. The index may be a single number, a range, or an array of such things.


Conversion between code point numbers and strings can be done with the cpToString() and stringToCp() functions. The stringToCp() function accepts a single index number or range, returning a single code point number or an array of them. The cpToString() function accepts a single code point or an array.
Conversion between code point numbers and strings can be done with the cp2s() and s2cp() functions. The s2cp() function accepts a single index number or range, returning a single code point number or an array of them. The s2s() function returns a string instead. The cp2s() function accepts a single code point or an array and returns a string.


The len() function returns the number of code points in a string.
The len() function returns the number of code points in a string.