ot::StringLength() function
Returns the number of characters that precede the terminating null character.
Arguments
aString
A pointer to the string.
aMaxLength
The maximum length in bytes.
Return value
The number of characters that precede the terminating null character or @p aMaxLength, whichever is smaller. `0` if @p aString is `nullptr`.