|
Ok, back to the beginning. This section of the program is going to read old directories used by the user. If the user decides to change the directory, that new directory goes into the database. Before entering it into the database, I want it to change the "\" to "/". Now, here lies the problem. While coding, the Java compiler connot simply find a "\". It interperates it as an escape character "\", not the actual character. All those solutions are valid and I thank you very much, but it doesn't strike the problem. Instead, they're doing it after-the-fact of FINDING the "\". The whole point is that the program needs to find "\" 's in a string and change them to "/". As I said, it's being ABLE to code the program to find the "\" without it thinking it's an escape character.
Ex:
(Please excuse the periods, forums doesn't allow empty spaces. Imagine empty space is there and not periods.)
dir.replace("\", "/");
|________| |____|
.......|.............|
.......|.............| ------(all in string according to the compiler)(errors here)
.......|........................(b/c the "\" appears as an escape character setup)
(Normal coding)
This is only one example to represent what will happen in other string manipulations.
I'm terrible at explaining things, sorry. I hope I explained it better this time.
__________________
What? Outside??? I have heard of that thing before, but I can't remember the details.
Last edited by Xian_Fung; Dec 12th, 2006 at 8:20 PM.
Reason: Looks wrong
|