Does anyone know how to get rid of a newline character? I am reading in from a file and there is a newline character attached to one of my strings that i dont want. Thank you.
Angel
Does anyone know how to get rid of a newline character? I am reading in from a file and there is a newline character attached to one of my strings that i dont want. Thank you.
Angel
It depends. Is the newline in the stream and you want to ignore it on a subsequent read? Use ignore(). Is the newline in a C++ string? You can use find and erase, or remove. Is the newline in a C style string? Then maybe somebody else can help.
That's unlikely. How are you reading from the file? What function are you using to read?I am reading in from a file and there is a newline character attached to one of my strings
I used the ignore and it work thank you both very much for helping