After you find the position of the first X you need to find the position of the first character from that point that isn't an X. The difference between those two positions is the length of the...