Final answer:
The correct statement that removes the spaces from the string and stores the result in the same string variable is option a. lastName = lastName.Trim();
Step-by-step explanation:
The correct statement that removes the spaces from the string and stores the result in the same string variable is option a. lastName = lastName.Trim();.
The Trim() method is used to remove leading and trailing white spaces from a string.
For example, if the initial value of lastName is " wilson ", after executing the lastName = lastName.Trim(); statement, the value of lastName will be "wilson" with no spaces.