Hi, im trying to create program that gets text input and than transforms don't into do not. Later i will have to remove (' , . ? -) as well from text.
So i tryed to look for d letter and than check what characters will come after that. If i find that they are 'd' 'o' 'n' '\' 't' i tryed to put back "do not" into the stringstream. If not than just put back all the letters i took.
PS. This probably is ultra bad way for this problem, so i would be happy to hear how to solve this in a smrter way
In this code if i enter
don't
as input im getting output
d
In this code if i enter
don't
and using a single whitespace after it as input im getting output
Cool that's exactly what i wanted - better solution for my problem. Thanks a lot. I will still leave this unanswered coz i want to know why my version didn't work
you should do that as Yanson showed.
you are trying in a difficult way. there are more errors in your code than you showed.
but you may want to compare with correct one: