View Single Post
  #2 (permalink)  
Old 04-22-2008, 09:16 PM
fireball2008 fireball2008 is offline
Member
 
Join Date: Apr 2008
Posts: 28
fireball2008 is on a distinguished road
Send a message via AIM to fireball2008
Assume that String
Code:
FourZero ="0000"; String num = some String from input; int difference = num.length()-FourZero.length(); for(int x=1; x<=difference; x++) if(FourZero.equals(num.subString(x,x+4))); System.out.println(num.subString(x-1,x+4));
I haven't tested the solution might be wrong.
you can just replace some output methods, but the genral idea is above.

Last edited by fireball2008 : 04-22-2008 at 09:20 PM.
Reply With Quote