public void TrimEverything() { //removes any accidental whitespaces at beginning and end of each string if (!string.IsNullOrEmpty(Name)) { Name = Name.Trim(); } if (!string.IsNullOrEmpty(Prefix)) { Prefix = Prefix.Trim(); } if (!string.IsNullOrEmpty(Surname)) { Surname = Surname.Trim(); } if (!string.IsNullOrEmpty(Residence)) { Residence = Residence.Trim(); } if (!string.IsNullOrEmpty(Country)) { Country = Country.Trim(); } if (!string.IsNullOrEmpty(Profile)) { Profile = Profile.Trim(); } if (Educations.Count > 0) { foreach (EducationExperience e in Educations) { e.Name = e.Name.Trim(); e.LevelOfEducation = e.LevelOfEducation.Trim(); e.OrganizationName = e.OrganizationName.Trim(); e.LocationOrganization = e.LocationOrganization.Trim(); } } if (Courses.Count > 0) { foreach (CourseExperience e in Courses) { e.Name = e.Name.Trim(); e.OrganizationName = e.OrganizationName.Trim(); e.LocationOrganization = e.LocationOrganization.Trim(); } } if (WorkExperiences.Count > 0) { foreach (WorkExperience e in WorkExperiences) { e.JobTitle = e.JobTitle.Trim(); e.TaskDescription = e.TaskDescription.Trim(); e.OrganizationName = e.OrganizationName.Trim(); e.LocationOrganization = e.LocationOrganization.Trim(); } } if (SideLines.Count > 0) { foreach (SidelineExperience e in SideLines) { e.JobTitle = e.JobTitle.Trim(); e.TaskDescription = e.TaskDescription.Trim(); e.OrganizationName = e.OrganizationName.Trim(); e.LocationOrganization = e.LocationOrganization.Trim(); } } if (References.Count > 0) { foreach (Reference e in References) { e.JobTitle = e.JobTitle.Trim(); e.Name = e.Name.Trim(); e.CompanyName = e.CompanyName.Trim(); } } if (Skills.Count > 0) { foreach (Skill e in Skills) { e.Name = e.Name.Trim(); } } if (Hobbies.Count > 0) { foreach (Hobby e in Hobbies) { e.Name = e.Name.Trim(); } } if (Competences.Count > 0) { foreach (Competence e in Competences) { e.Name = e.Name.Trim(); } } }