RuleSuite.cs #1

  • //
  • guest/
  • Necqui/
  • Documents/
  • Projects/
  • vsDotNet/
  • AddressSolution/
  • AddressSolution/
  • AddressRules/
  • RuleSuite.cs
  • View
  • Commits
  • Open Download .zip Download (873 B)
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();
            }
        }
    }
}
# Change User Description Committed
#1 21700 Necqui Initial Load