C++ Program:

- To find the string length

Example:

User Input: Hello World

Output: 11

#include <iostream>
using namespace std;

int main() {
  string s1;
  cout<<"Enter your string : ";
  getline(cin,s1);

  cout<<"String length : "<<s1.length();
  return 0;
}

Output:

  Enter your string : Blue Sky
  String length : 8
Program
basic
s1.length()

OR

s1.size()

Use length() or size() method to find any string length

Concept

Coming Soon !

Quick
Tutorial

Quote

Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning.