comparison in forloop : i am fairly new to java and came across a problem while working on a project where i need to extract some data by comparing each result that i get out of a forloop with the other.

The forloop is to get results out of an sql query & the code for the forloop is as following:

          for (Map<String, Object> row : results) {
				String data= row.get("getdata").toString();
				}

The data recieved out of this when the loop runs 2 times is somewhat like:

a12:1:123;b23:2:234;c24:3:344 

a12:1:123;b23:2:234;c24:4:345

when, in the above data for the same first vale, the second value after ":" is different, i  want to get the third value, for example between c24:3:344 & c24:4:345 the second value is different i.e. 3 and 4 so i need to get 344 and 345.
similarly i need to find any such data in the results received by the for loop.

All you help is greatly appreciated and thanks in advance.