For a string to be able to resonate, a wave must fit between both ends, as the following figure shows:
Notice that this happens whenever the length of the string is a multiple of half the wavelength of the wave.
Since this happens only if the sting is a multiple of the half-wavelength interval and not any half-wavelength interval, then the answer is: