dimanche 1 décembre 2019

How can I use this blank space in an if statement?

I am new to programming and I am trying to scan in strings from a text file and assign each string to variables but some lines in the text file have 4 variables I need to assign but others only have 3. On the lines that only have 3 variables I need to assign what would be the 4th variable a value without assigning it the first string in the next line. I managed to get to the point where it assigns all the variables correctly except for the would be 4th variables on the lines with only 3 variables for me to assign. on these variables it assigns them a blank space but no matter what i try I cannot compare these blank spaces in an if statement to assign them the correct strings. This is the code I have. This is the text file I am scanning. I have checked value stored in these variables and they are not null it shows a blank space but whenever I try " " or any escape characters it does not work.

Aucun commentaire:

Enregistrer un commentaire