Пример #1
0
 protected static IEnumerable <string> ExtractLinesFromWordFile(string filePath, Encoding encoding)
 {
     return(StaticEncodingLineReader.ReadLines(filePath, encoding)
            .Where(line => !string.IsNullOrEmpty(line))
            .Select(line => line.Trim(SpaceOrTab))
            .Where(line => line.Length != 0));
 }
        protected static IEnumerable <string> ExtractLinesFromWordFile(string filePath, Encoding encoding, bool allowBlankLines = false)
        {
            var results = StaticEncodingLineReader.ReadLines(filePath, encoding)
                          .Where(line => line != null)
                          .Select(line => line.Trim(SpaceOrTab));

            if (!allowBlankLines)
            {
                results = results.Where(line => line.Length != 0);
            }

            return(results);
        }