Here is my code below, how can I make the if return true as it currently skips over the if statement because of the string values has a space in it.
string instrucType = "FM";
string tenInstrucType = "FM ";
if (tenInstrucType.Equals(instrucType))
{
blLandlordContactNumberHeader.Visible = true;
lblLandlordContactNumber.Text = landlordData.LandlordContact.DefPhone;
lblLandlordEmailHeader.Visible = true;
lblLandlordEmail.Text = landlordData.LandlordContact.DefEmail;
}
Use the Trim function:
This will only trim from the ends though. If there is a possibility of a space in the middle, use the Replace.