Answer to Question #312292 in C++ for Ally

Question #312292

Delete a word from the given string. Popup a message if the string is empty. 


1
Expert's answer
2022-03-15T16:45:43-0400

Here is program:

int main()
{
	string str;
	int delstr;
	cin >> str;
	cin >> delstr;
	str.erase(delstr);
	if (str == "")
	{
		cout << "String empty" << endl;
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment