std::erase - std::remove not working

Flaviu_ 1,031 Reputation points
2023-06-30T05:52:56.93+00:00

I have the following code:

	std::wstring data{ L"”something”" };
	data.erase(std::remove(data.begin(), data.end(), '”'), data.end());
	std::wcout << data.c_str() << std::endl;

Why the code doesn't remove that char ? See output:
User's image

Not so important, didn't dispaly on the output at all. The project is Use Unicode Character Set.

Developer technologies | C++
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 122.6K Reputation points
    2023-06-30T06:40:21.3133333+00:00

    Try to remove this character: L'”'.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.