help with using strings and if statements

I am making a code that is supposed to find a zip code and if it is only 4 digits it means it is missing a zero in the beginning i was trying to use this for the coding but it is not working.

<Find all zip codes with 4 numbers
if (line.substr(line+5=="\t")

i am also having trouble with the outputs with two other parts it doesnt give me an error but it doesnt find any of the lines in the text file its this one

<if (line.substr(0)=="" )

<// hyphen zip codes
index = line.rfind("/t");
if (line.substr(index+6)=="-")
numberofhyphenzipcodes++ ;

can anyone guide me to what i am doing wrong?
Topic archived. No new replies allowed.