/
jhayphal
/
CitReportDesigner
Обзор
Документация
Войти
/
jhayphal
/
CitReportDesigner
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
CitReport.IO/Parser/DisplayFieldsHelper.cs
49 строк
934 B
Oleg Nazarenko
Исправил парсинг полей в TableCellParser.
25 фев 2023, 21:36
25 фев 2023, 21:36
7d7cc49
Код
Авторство
О чём код?
namespace CitReport.IO.Parser; public static class DisplayFieldsHelper { public static int GetCount(string text) { if (text == null) { return 0; } var count = 0; var position = 0; while (position < text.Length) { while (position < text.Length && text[position] != '_') { ++position; } ++count; if (position > 0 && text[position - 1] == '<' && position + 1 < text.Length && text[position + 1] == '>') // field like <_> { position += 2; continue; } while (position < text.Length && text[position] == '_') // field like ____ { ++position; } if (position < text.Length && text[position] == '.') // field like ______.__ { ++position; } while (position < text.Length && text[position] == '_') { ++position; } } return count; } }