.length() method returns the length of the given string in terms of bytes. It functions exactly like the .size() method but follows a more intuitive terminology (i.e., “the length of a string” rather than “the size of a string”). However, both methods yield the same result.
string must be defined with
std::string prior to using with the
In the example below,
.length() is called on the