public static IPAddressRange ParseSip(string sip) { if (string.IsNullOrWhiteSpace(sip)) { throw new FormatException("sip is optional but cannot be empty"); } string[] strArrays = sip.Split(new char[] { '-' }); if ((int)strArrays.Length > 2) { throw new FormatException("sip only supports one range"); } if ((int)strArrays.Length != 2) { return(IPAddressRange.ParseIPV4(sip)); } return(IPAddressRange.ParseIPV4(strArrays[0], strArrays[1])); }