I have 2D array called grid which in column  has string in the format 01/03/2003, I don't want to deal with date formats as im only concentrated on the year, therefore i use substring and compare it to the year in question (as seen below).
My question is, how come the if statement only seems to iterate once? It should iterate a fair few times as the first 30 dates are "2003".
If you (original poster) were expecting your posted code to iterate through a loop, I am interested to know from which other programming language you have come to Java. Something rather different, I guess!
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Joined: Mar 01, 2006
lol no, java is my first language, im just a bit slow. Thanks for your help, i'll put it inside another loop. Cheers
Two little hints: 1. About code readability and code reuse: use endsWith() instead of substring() followd by an equals() 2. About code reliability: what happens if for some reason you call the substring on a String which is long...let's say...4 chars?