I think I need to take out the pos >= 0, and use "if (pos != string::npos) { " but not even sure what that means. Here is what I have so far:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream>
#include <string>
usingnamespace std;
int main() {
string tweet;
unsignedint pos;
cout << "\nEnter tweet:"; // User enters a complete tweet (160 characters or less)
getline(cin, tweet); // Gets the single line of text
tweet.resize(160); // Resizes to 160 characters
pos = tweet.find("LOL");
if (pos >= 0) { // Note: This expression asks: Does the tweet have "LOL" anywhere?
tweet.replace(pos, 3, " laughing out loud ");
}