Results 1 to 7 of 7
- 06-02-2009, 04:28 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 47
- Rep Power
- 0
- 06-02-2009, 04:38 AM #2
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
Java paths always use a forward slash ("/") instead of a backslash ("\") because special characters such as the newline character begin with a backslash. Change all the backslashes in your path to forward slashes and it should work.
Good Luck,
Singing BoyoIf the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
- 06-02-2009, 07:46 AM #3
Hi,
Use the String like this with escape sequence.It will work
private static final String DICTIONARY_FILE = "C:\\Users\\Sterling\\Documents\\FlashCards.tx t";
-Regards
RamyaRamya:cool:
- 06-02-2009, 11:16 AM #4
I think the way said by ramya can fix your problem.
It is right way to avoid invalid escape sequence.Mak
(Living @ Virtual World)
- 12-01-2009, 01:07 AM #5
Member
- Join Date
- Dec 2009
- Posts
- 1
- Rep Power
- 0
I'm having the same problem with the "\",
But if it's in quotes, shouldn't it be disregarded?
I'm trying to create what I like to call "ASCII Art" in Java, using Eclipse as a compiler.
The code that I'm trying to get working is:
Except the lines with backslashes give me all the trouble. is there any way to bypass this problem?Java Code:System.out.print(" _________ ________.____ __ "); System.out.print(" \_ ___ \ / _____/| | __ _________| | __ ___________ "); System.out.print(" / \ \// \ ___| | | | \_ __ \ |/ // __ \_ __ \"); System.out.print(" \ \___\ \_\ \ |___| | /| | \/ <\ ___/| | \/"); System.out.print(" \______ /\______ /_______ \____/ |__| |__|_ \\___ >__| "); System.out.print(" \/ \/ \/ \/ \/ "); System.out.print(" __________ .___ __ .__ "); System.out.print(" \______ \_______ ____ __| _/_ __ _____/ |_|__| ____ ____ ______"); System.out.print(" | ___/\_ __ \/ _ \ / __ | | \_/ ___\ __\ |/ _ \ / \ / ___/"); System.out.print(" | | | | \( <_> ) /_/ | | /\ \___| | | ( <_> ) | \\___ \ "); System.out.print(" |____| |__| \____/\____ |____/ \___ >__| |__|\____/|___| /____ >"); System.out.print(" \/ \/ \/ \/ ");
~c0rsana
- 12-01-2009, 06:39 AM #6
Senior Member
- Join Date
- Nov 2009
- Posts
- 150
- Rep Power
- 4
double your backslashes, its the onliest you can do
-
In my opinion a better solution is to put the ascii art into a text file and read it into your program. Do this and you won't need double backslashes, the text can retain its beauty and everything will still function. YMMV.
edit: you'll also need println calls, not print.
edit2: c0rsana: I just noticed that you hijacked an old thread. Please don't do this but instead ask a new question in a new thread. Thank you for your cooperation.Last edited by Fubarable; 12-01-2009 at 01:47 PM.
Similar Threads
-
Escape Sequence
By Punter in forum New To JavaReplies: 4Last Post: 02-10-2009, 07:04 AM -
Escape Sequence \t does not display.
By dreamingofgreen in forum New To JavaReplies: 7Last Post: 07-22-2008, 04:50 AM -
Using escape sequence with like clause (%)
By Java Tip in forum Java TipReplies: 0Last Post: 02-14-2008, 09:57 AM -
Using escape sequence with like clause (_)
By Java Tip in forum Java TipReplies: 0Last Post: 02-14-2008, 09:55 AM -
Escape sequence problem
By eva in forum New To JavaReplies: 2Last Post: 01-21-2008, 10:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks