I have a requirement to remove "\n\t" from the input string?
For example,
"lorenda bianco"
<loredana.bianco@yahoo.co.jp>
is invalid input for me. (just \n)
"lorenda bianco"
<loredana.bianco@yahoo.co.jp>
is valid input for me. (\n\t).
I tried with isspace, but don't know how to make combination of different whitespaces.
I want my output as "lorenda bianco" <loredana.bianco@yahoo.co.jp>
.
I am able to get rid of "\n" with the help @404. But still, \t doesn't work neither with his solution nor erase/remove. I am also trying to remove \t with:
s.erase(std::remove_if(s.begin(), s.end(), '\t'), s.end());
which somehow doesn't work. But when I print it shows 4 separate spaces instead of a single tab. May be that's why it doesn't work. It expects single tab instead of 4 consecutive space characters. Don't know how to crack it.
--- Failed attempt to remove \n\t from string (\n works but \t still exists )
str before ws removal: "lorenda bianco"
<loredana.bianco@yahoo.co.jp>
str after ws removal: "lorenda bianco" loredana.bianco@yahoo.co.jp