2 Replies Latest reply on Apr 30, 2007 9:29 AM by GregConnTelevirtual

    tokenizing a string

    GregConnTelevirtual Level 1
      I'm taking 2 four digit numbers from a text file and i need to subtract one from the other. I've hit a problem if the number being subtracted from the other begins with a zero then the result is sometimes is really wrong. So i'm kind of thinking that i may need to take the zero off the beginning before the calculation is made. I would do this by tokenizing in c/c++ but i cant find that kind of function in flash, is there another way? or can anyone tell me the reason that the calculation is coming out wrong although it is not a regular error so i'm thinking tokenizing is best.
      One solution i came up with was using a case statement but is there a way in a actionscript to check if just the first digit is a zero as the rest of the digits dont matter, i.e in something like SQL you can use % or * to represent a bunch of characters rather than just one.