This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread 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 Android Security Essentials Live Lessons this week in the Android 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: 19656
    
  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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Splitting String Problems
 
Similar Threads
Using split method with String
Splitting Between String and Numbers
An easy question about swap
split() method problem
Alternative to string tokenzier