Returns the length of the String, in characters. (Note that this doesn't include a trailing null character.)
// SYNTAX string.length() // PROTOTYPE inline unsigned int length(void) const;
- string: a variable of type String
Returns: The length of the String in characters.
length() function is fast and is constant for any length of string, Ο(1). You can efficiently use
length() to determine if a string is empty:
length() == 0.