Check out example codes for "stringlength in c++". It will help you in understanding the concepts better.

Code Example 1

string txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << "The length of the txt string is: " << txt.size();

Code Example 2

string txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << "The length of the txt string is: " << txt.length();

Code Example 3

str.length();

Code Example 4

string txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << "The length of the txt 
  string is: " << txt.length();

Learn ReactJs, React Native from akashmittal.com