Logo

Programming-Idioms

History of Idiom 169 > diff from v49 to v50

Edit summary for version 50 by programming-idioms.org:
Admin deletes impl 2444

Version 49

2018-10-01, 12:18:38

Version 50

2018-10-01, 20:50:16

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
Imports
#include <string.h>
Code
int n = strlen(s);