Logo

Programming-Idioms

History of Idiom 169 > diff from v14 to v15

Edit summary for version 15 by programming-idioms.org:
[Pascal] 2 ways => 2 impls, see new impl 2217

Version 14

2018-01-27, 12:46:14

Version 15

2018-01-27, 12:47:09

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Extra Keywords
size
Extra Keywords
size
Imports
uses LazUtf8;
Imports
uses LazUtf8;
Code
n := length(s); //single byte encoding or widestring, plain pascal
n := Utf8Length(s); //UTF8-encoding, as used in Lazarus
Code
n := length(s);
Comments bubble
Single byte encoding or widestring, plain pascal