Ive got a small problem that i need to fix. I am using ifstream to readline a file full of terminated string lines that contain filenames/paths.
I need to replace all the '\'s in the read lines and turn them into '/'s. Of course attempting to replace "\" wont work in code and i have also tried "\\" but it seems to take that literally.
Any ideas? If it were basic i would be tempted to try chr(asciicode) but am a bit stuck finding the equivalent.
There should be no "\0"s in there so i assume each line string is complete :7
All you need to do is replace all '\\' with '/'. Using single quotes instructs the compiler to replace that with the appropriate character code (e.g. '@'==64, 'A'==65, 'B'==66, etc.)
Thanks thats exactly what i was after, i have written a simple function to "clean" up the input i am getting from the readline. (\r was causing me a few confusing woes too :) i only worked that one out when i ran a watch on the contents)