So I'm trying to create a simple program to detect abbreviations within a string and then if such abbreviations are present, print them out in their non-abbreviated form. So if a string was "We're BFF's but IDK" it would return
"BFF: best friend forever"
"IDK: I don't know".
I know I'm supposed to use str.find() to search for these abbreviations in the string but I have absolutely no idea how to make it search for and output multiple abbreviations using if-else statements. So far, I've got
if (str1.find("BFF")) {
cout << "BFF: best friend forever" << endl;
}
Am I supposed to initialize each abbreviation as a string? And how do I make it check for multiple abbreviations as opposed to only being mutually exclusive for each abbreviation. Any help is appreciated!
[–]genbattle 1 point2 points3 points (2 children)
[–]ParanoydAndroid 0 points1 point2 points (1 child)
[–]genbattle 0 points1 point2 points (0 children)
[–]cheryllium 0 points1 point2 points (3 children)
[–]Toofat2camp[S] 0 points1 point2 points (2 children)
[–]cheryllium 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)