Logo

Programming-Idioms

History of Idiom 169 > diff from v68 to v69

Edit summary for version 69 by Roie8:
New Cobol implementation by user [Roie8]

Version 68

2019-09-27, 09:47:57

Version 69

2019-09-27, 23:09:30

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.

Illustration

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.

Illustration
Extra Keywords
size characters chars number runes
Extra Keywords
size characters chars number runes
Code
IDENTIFICATION DIVISION.
PROGRAM-ID. length.
PROCEDURE DIVISION.
   MOVE FUNCTION LENGTH(s) TO n
STOP RUN.