Question: What am I missing? How do I remove that space on the last line. #include #include #include #include using namespace std; //method to split string

What am I missing? How do I remove that space on the last line.

#include #include #include #include using namespace std; //method to split string into words vector split(string str, char delimiter) { vector internal; stringstream ss(str); // Turn the string into a stream. string token; while(getline(ss, token, delimiter)) { internal.push_back(token); } return internal; } int main(){ //declaring variables string input; cout res = split(input, ' '); for(int i=0;i

cout

What am I missing? How do I remove that space on the

1. Compare output Input IDK how that happened. T Enter text: Your output correctly starts with You entered IDE how that happened TTYL 2. Compare output Input IDK how that happened. T Enter text: Your output You entered IDF how that happened TTYL Expanded I don't know how that happened. talk to you later 3. Compare output I'll fix it JK, you know IDK how Input Enter text: Your output You entered I'll fix it JK, you know IDK how Expanded I'll fix it. just kidding you know I don't know how 4. Compare output nput Your bff, my BFF, and her BFF are all there Enter text: Your output You entered Your bff r my BFF and her BFF are all there Expanded Your boff, my best friend forever and her BFF are all there Enter text: Expected output You entered Your bff r my BFF and her BFF are all there Expanded Your bff my best friend forever and her BFF are all there

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!