Lora
asked on
a function problem
Could You help me to write a function that would remove trailing blanks
and tabs from each line of input, and it would delete entirely blank lines.
Thank You!
and tabs from each line of input, and it would delete entirely blank lines.
Thank You!
I could but not for 5 pts... Maybe someone else needs them badly enough to bite.
ASKER
I'm really sorry that's all I've got.
Are you referring to an input stream.
ASKER
Yes.
Please help me with this problem.
Please help me with this problem.
If you want to use CStrings, you can use TrimLeft and TrimRight.
Basically, your code would look like this:
CString myStr;
// Set the value of myStr here
myStr.TrimLeft();
myStr.TrimRight();
while(myStr.Replace("\r\n\ r\n", "\r\n") > 0) ;
while(myStr.Replace("\n\n" , "\n") > 0) ;
I can write code using traditional DOS string functions if you like.
Basically, your code would look like this:
CString myStr;
// Set the value of myStr here
myStr.TrimLeft();
myStr.TrimRight();
while(myStr.Replace("\r\n\
while(myStr.Replace("\n\n"
I can write code using traditional DOS string functions if you like.
ASKER
Can you please write it using traditional DOS string function
This will take a little while. I'll try to have it posted as soon as possible.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hope you will give me more points and a better grade if you have the points.
Thanks
hongjun
Thanks
hongjun