private static List <NumberSeparator> GetNumberSeparators(IEnumerable <string> separators, NumberSeparator.SeparatorType type) { var numberSeparators = new List <NumberSeparator>(); foreach (var separator in separators.Where(a => !string.IsNullOrEmpty(a))) { if (numberSeparators.Exists(a => a.Value == separator && a.Type == type)) { continue; } var numberSeparator = new NumberSeparator { Type = type, Value = separator }; numberSeparators.Add(numberSeparator); } return(numberSeparators); }
private bool IsOfSeparatorType(string value, NumberSeparator.SeparatorType type) { return(_separators.Where(a => a.Type == type).Any(numberSeparator => numberSeparator.Value == value)); }
private static List <NumberSeparator> GetConvertedSeparators(List <string> thousandSeparators, NumberSeparator.SeparatorType type) { var convertedSeparators = new List <NumberSeparator>(); thousandSeparators.ForEach(sep => convertedSeparators.Add(new NumberSeparator { Type = type, Value = sep })); return(convertedSeparators); }