public string GetNameFromEnum(PSXAPI.Response.Payload.PokemonID id) { string result = null; if (!string.IsNullOrEmpty(id.ToString())) { var foundName = Names.ToList().Find(x => string.Equals(x.Replace("-", "").Replace(" ", "").Replace("'", ""), id.ToString(), StringComparison.InvariantCultureIgnoreCase)); result = string.IsNullOrEmpty(foundName) ? null : foundName; } return(result); }
public string GetNameFromEnum(PSXAPI.Response.Payload.PokemonID id) { string result = null; if (!string.IsNullOrEmpty(id.ToString())) { var foundName = Names.ToList().Find(x => x.Replace("-", "").Replace(" ", "") .ToLowerInvariant() == id.ToString().ToLowerInvariant()); result = string.IsNullOrEmpty(foundName) ? null : foundName; } return(result); }