1234
#include <string> ... string str = "How to replace a period ( dot ' . ' ) with a space."; ...
str.replace(str.end()-1,str.end()," ");
12
size_t found = str.find_last_of("."); str.replace(found,1," ");
string s="you don't care." cout<<s;//prints 'you don't care.' string s="you don't care " cout<<s;//prints 'you don't care ' e is followed by char(32)