String length: Difference between revisions
Content added Content deleted
(→{{header|Haskell}}: ++ gnu octave) |
m (oct...) |
||
Line 359:
swap 1+
repeat drop ;</lang>
=={{header|GNU Octave}}==▼
<lang octave>s = "string";▼
stringlen = length(s)</lang>▼
This gives the number of bytes, not of characters. e.g. length("è") is 2 when "è" is encoded e.g. as UTF-8.▼
=={{header|Haskell}}==
Line 617 ⟶ 611:
UTF8.length "møøse"
</lang>
▲<lang octave>s = "string";
▲stringlen = length(s)</lang>
▲This gives the number of bytes, not of characters. e.g. length("è") is 2 when "è" is encoded e.g. as UTF-8.
=={{header|Perl}}==
|