Kat H.

asked • 04/26/21

Tag Remover. Read in a string that may have spaces (use getline!).

Read in a string that may have spaces (use getline!). In the string will be something that looks like [TAG]text inside tag[/TAG] where TAG can be any string. Print out the TAG, a colon, and the text between the first ] and next [.


Sample:

Input: [body]This is some text[/body]
Output: body:This is some text

Input: Hello [b]class[/b].
Output: b:class


Code:


#include <iostream>

#include <string>

using namespace std;


//Turn off loops - you should not need them!

#define for "OhNoYouDont"

#define while "GetThatOutOfMyKitchen"



//Do not modify anything on or above the line below this

//YOUR_CODE_BELOW

int main()

{

//YOUR_CODE

}

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.