Logo

Programming-Idioms

History of Idiom 169 > diff from v15 to v16

Edit summary for version 16 by xgladius:
New Cpp implementation by user [xgladius]

Version 15

2018-01-27, 12:47:09

Version 16

2018-02-01, 04:34:49

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
import <string>
Code
std::string x = "string len";
int xlen = x.length();
Comments bubble
1. make new string
2. x.length() returns string length
Doc URL
http://www.cplusplus.com/reference/string/string/length/