I have a string that contains what ever the user has input
string userstr = \"\"; cout << \"Please enter a string \"; getline (cin, userstr); <
string userstr = \"\"; cout << \"Please enter a string \"; getline (cin, userstr);
Here is one way to do it
for(int i=0;i