Well this is an example so for shure it is not going to work with your code. You will have to adapte the thing. How ever the substring() function is the one you need along with some other functions you can find on the page, like toInt()
But now the question become, do you need help, or do you want us to do it for you?