Logo

Programming-Idioms

History of Idiom 169 > diff from v27 to v28

Edit summary for version 28 by Matek:
[Pascal] Fixed code.

Version 27

2018-03-10, 23:14:56

Version 28

2018-03-10, 23:16:20

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 sysutils;
Imports
uses sysutils;
Code
n := s.length();
Code
n := s.length;
Comments bubble
Works correctly in Lazarus IDE v. >= 1.8.0.
Comments bubble
Works correctly in Lazarus IDE v. >= 1.8.0.
Doc URL
https://www.freepascal.org/docs-html/rtl/sysutils/tstringhelper.length.html
Doc URL
https://www.freepascal.org/docs-html/rtl/sysutils/tstringhelper.length.html