Java split string at “,” and end of line

I have some data that looks like this:


Now I do want to split the string at the "," and at the end of the line. I tried it like this:

String[] results = file.split(",");

This works fine, but when I try this:

String[] results = file.split(",||\\n+");

The whole thing gets messed up, I hope you can help :)


You can use a better way:

String[] results = a.split(",|"+System.getProperty("line.separator")+"+");

Because the line separator changes between OS..

Try this:

String[] results = file.split(",|\\n+");

Need Your Help

swfobject.embedSWF not working in iOS

javascript ios youtube youtube-api swfobject

I'm learning how YouTube player works with Javascript. I have this code because I want to make a video gallery and it works perfectly in any browser (the idea is to switch between videos by the ID)...

Anyway to make a (wrapping) NSTextField write a carriage return upon pressing return key?

objective-c cocoa nstextfield

I want to use a wrapping text field that can potentially contain carriage returns in my app. Is there any way to force the NSTextField object to write a carriage return into the text area instead of

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.