#include <bits/stdc++.h>
using namespace std;
int main(){

    // initliazing string
    string str = "Hello";
    cout<<str<<endl;

    // iterate over strings
    cout<<"Iterate over strings"<<endl;
    for (int i = 0; i < str.length(); i++)
    {
        char ch = str.at(i);
        cout<<ch<<endl;
    }
    
    cout<<endl;
    // Two Methods to find character position/index
    char ch = str[0];
    cout<<"Methods 1: "<<ch<<endl;
    cout<<"Methods 2: "<<str.at(3)<<endl;
    cout<<endl;

    // find the length/sizeof()/size/capacity] of the strings
    cout<<"The length of the string is "<<str.length()<<endl;
    cout<<"The size of the strings is "<<str.size()<<endl;
    cout<<"The byte strings contain is "<<sizeof(string)<<endl;
    cout<<"The capacity it store is "<<str.capacity()<<endl;

    cout<<endl;
    // Substrings 
    string ss = str.substr(0,2);
    cout<<"The substrings between index 'hello' (0,2): "<<ss<<endl;
    return 0;
}