public static string Purify(this string val) { if (val == null) { return(null); } val = val.Replace('\n', ' ').TrimStart(); if (string.IsNullOrEmpty(val)) { throw new ArgumentNullException("val"); } if (val.Length < ShiolExtension.getMinimumLength()) //ShiolConfiguration.Instance.Config.MinLengthFrame) { LogFile.saveRegistro($"Trama ({val.Length})debe ser más grande que el tamaño mínimo = {ShiolExtension.getMinimumLength()}", levels.error); return(null); } return(val); }
public static string Purify(this string val) { if (val == null) { return(null); } val = val.Replace('\n', ' ').TrimStart(); if (string.IsNullOrEmpty(val)) { throw new ArgumentNullException("val"); } String[] strList = ShiolConfiguration.Instance.Config.ExcludedStrings.Split(','); foreach (var str in strList) { if (val.IndexOf(str) > -1) { Console.WriteLine("Excluding string: >>" + str + "<<"); return(null); } } if (val.Length < ShiolExtension.getMinimumLength()) //ShiolConfiguration.Instance.Config.MinLengthFrame) { LogFile.saveRegistro($"Trama ({val.Length})debe ser más grande que el tamaño mínimo = {ShiolExtension.getMinimumLength()}", levels.error); return(null); } return(val); }