Hello,
I'm hoping somebody can help me out with something that seems fairly simple!
I have a character variable called 'Emp' which is 12 characters long and contains the numbers 1 and 0 only. For example;
111111111111
110111111111
111111111110
011111111111
011011110110
I am trying to work out the difference between the position of the first '1' and the last '1' for each row. The answers should be 11 (for the 1st row), 11 (for the 2nd row), 10 (for the 3rd row), 10 (for the 4th row) and 9 (for the 5th row).
Can somebody help me put this in to a code without having to go through each line manually?
Thank you