String Character Length: Difference between revisions

XSLT
(Haskell: Unicode information)
(XSLT)
Line 1:
{{task}}
{{Template:split-review}}
In this task, the goal is to find the <em>character</em> length of a string. This means encodings like [[UTF-8]] need to be handled properly, as there is not necessarily a one-to-one relationship between bytes and characters. (For example, in UTF-8 the character length of "møøse" is 5 but the byte length is 7.)
 
For byte length, see [[String Byte Length]].
Line 337:
Returns the length of the string|varname
Returns null if string|varname is null
 
=={{header|XSLT}}==
<?xml version="1.0" encoding="UTF-8"?>
...
<xsl:value-of select="string-length('møøse')" /> <!-- 5 -->
 
=={{header|xTalk}}==
Anonymous user