permaculture playing cards*
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 19723
    
  20

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!
 
wood burning stoves
 
subject: Splitting String Problems