public void Trim() { if (!string.IsNullOrEmpty(CurrentPassword)) { CurrentPassword = CurrentPassword.Trim(); } if (!string.IsNullOrEmpty(NewPassword)) { NewPassword = NewPassword.Trim(); } if (!string.IsNullOrEmpty(ConfirmNewPassword)) { ConfirmNewPassword = ConfirmNewPassword.Trim(); } }