using System; using System.Collections.Generic; using AddressSolution.Common; namespace AddressSolution.AddressRules { public static class RuleSuite { public static string GetSuite(string address) { { List<string> suites = ValidCollections.GetSuites(); // replace comma with space string addressLine = address.Trim().Replace(",", " "); string suite = string.Empty; foreach (var s in suites) { var streetTypeFound = addressLine.IndexOf(s, StringComparison.OrdinalIgnoreCase); if (streetTypeFound > -1) { suite = s; break; } } return suite.Trim(); } } } }