Answers for "print all substrings in c++"

C++
0

print all substrings in c++

void printsubstr(string s, int n){
    for(int i=0;i<n;i++){
        for(int j=1;j<=n-i;j++){
            cout<<s.substr(i,j)<<endl;
        }
    }
}
Posted by: Guest on May-01-2021

Browse Popular Code Answers by Language