This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Splitting String Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Splitting String Problems" Watch "Splitting String Problems" New topic
Author

Splitting String Problems

Jasper Beckers
Greenhorn

Joined: Sep 05, 2009
Posts: 4
Whenever I try to use the String .split method, I get this error: Invalid Escape Sequence, even when I try to do really basic stuff like this:



Can someone help me out?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19679
    
  18

You can start by posting the actual code, because your code compiles and runs just fine for me (well, after I dropped the "extends Applet" and changed the init() method into a static main method).

You have one major bug in your code though. You should never use == for comparing Strings; use equals instead:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jasper Beckers
Greenhorn

Joined: Sep 05, 2009
Posts: 4
Ah, I see now, thanks!
 
jQuery in Action, 2nd edition
 
subject: Splitting String Problems