Results 1 to 3 of 3
- 06-24-2011, 07:09 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 2
- Rep Power
- 0
Possible to ignore escape sequences?
Hello all,
I have been working on an application that involves the user typing in the path to a file (I don't want to use the FileChooser at this point). However, when it asks for the file path string you have to escape every directory '\'. So this is what you would need to point to a file: "C:\\path\\to\\file". Is there anyway that I can have the string ignore the '\' escape sequence?
I'm not sure if this is regex material or not, because if so I have no idea how that would work..
Thanks,
lordj
- 06-24-2011, 07:23 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
This is not entirely true; if you specify a String literal to the compiler it'll translate the String as you've shown above, but if you, say, read a String from the user input, no escaping or String processing happens, i.e. a double \ stays a double \; it is also no regexp issue.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 06-24-2011, 07:26 PM #3
Member
- Join Date
- Jun 2011
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Java won't play midi sequences. How can I get this to work?
By misternopps in forum New To JavaReplies: 1Last Post: 05-26-2011, 10:14 AM -
for loops and escape sequences
By orangefest in forum New To JavaReplies: 1Last Post: 04-19-2009, 08:55 PM -
Generating number sequences
By hawkmauk in forum New To JavaReplies: 0Last Post: 11-15-2007, 03:32 PM -
Oracle sequences
By orchid in forum JDBCReplies: 5Last Post: 04-19-2007, 03:47 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks