• Post Reply Bookmark Topic Watch Topic
  • New Topic

split string into multiple strings  RSS feed

 
gnana sankaran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I need a source to split a string into multiple strings like below

String s=”age<=10 height<=99 result_positive age<12 height<=111 result_negative age<=20 height<=125 result_positive age<=25 height<=167 result_positive”;

I need to spilt the above string into multiple strings based on result_positive and result_negative like below

String s1= age<=10 height<=99 result_positive ;
String s2= age<12 height<=111 result_negative;
String s3= age<=20 height<=125 result_positive;
String s4= age<=25 height<=167 result_positive;

any one provide a solution for that.

 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gnana,

We tend to get a bit cynical here, but this looks a lot like a homework assignment that you're asking us to do for you. Maybe you could tell us what you've tried so far, and why it's not working for you?

Also, I'm going to move this thread over to our Beginning Java forum.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!