String length: Difference between revisions
m
→{{header|Phix}}: added syntax colouring the hard way, phix/basics
MaiconSoft (talk | contribs) (Added Delphi reference to Pascal code) |
m (→{{header|Phix}}: added syntax colouring the hard way, phix/basics) |
||
Line 2,304:
=={{header|Phix}}==
{{libheader|Phix/basics}}
The standard length function returns the number of bytes, character length is achieved by converting to utf32
<!--<lang Phix>-->
<span style="color: #008080;">constant</span> <span style="color: #000000;">s</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"𝔘𝔫𝔦𝔠𝔬𝔡𝔢"</span>
<span style="color: #0000FF;">?<span style="color: #7060A8;">length<span style="color: #0000FF;">(<span style="color: #000000;">s<span style="color: #0000FF;">)</span>
<span style="color: #0000FF;">?<span style="color: #7060A8;">length<span style="color: #0000FF;">(<span style="color: #000000;">utf8_to_utf32<span style="color: #0000FF;">(<span style="color: #000000;">s<span style="color: #0000FF;">)<span style="color: #0000FF;">)
<!--</lang>-->
{{out}}
<pre>
|