protected string RemoveCharacters(string name) { string result = new[] { "-", ",", "/", ":", " ", " ", "." }.Aggregate(name, (current, s) => current.Replace(s, "")); return result.ToLowerInvariant(); }
/// <summary> /// Replaces characters that are not necessary for comparing (like whitespaces) and diacritics. The result is returned as <see cref="string.ToLowerInvariant"/>. /// </summary> /// <param name="name">Name to clean up</param> /// <returns>Cleaned string</returns> protected string RemoveCharacters(string name) { string result = new[] { "-", ",", "/", ":", " ", " ", ".", "'" }.Aggregate(name, (current, s) => current.Replace(s, "")); result = result.Replace("&", "and"); return StringUtils.RemoveDiacritics(result.ToLowerInvariant()); }