substring issue

Hi everyone, I am trying to divide an integer number into several Strings, each of them containing 3 characters. (For example 12345678 should be "123", "456","78")I wrote the following simple code, which seems pretty fine to me. The problem is that I get an Exception at my first substring function. I tried debugger and it seems that the exceptions is caused by the function b.substring(0,2), whereas my integer is something like 1234234. To me b.substring (0,2) should return ("123")

Can someone please tell me what I am doing wrong? I am new to Java so this is probably gonna be really simple, but I dont see it.