BExIS.IO.Transform.Input.AsciiReader.textMarkerHandling C# (CSharp) Метод

textMarkerHandling() приватный Метод

If a seperator is present in a text which is highlighted with highlighter (bsp quotes), which is a special case which is treated in this function
private textMarkerHandling ( string row, char separator, char textmarker ) : List
row string a row that needs to be checked
separator char Character as Delimeter for the line (TextSeparator)
textmarker char Character as TextMarker for the line
Результат List
        private List<string> textMarkerHandling(string row, char separator, char textmarker)
        {
            List<string> values = row.Split(separator).ToList();

            /// <summary>
            /// check if the row contains a textmarker
            /// </summary>
            /// <remarks></remarks>
            if (row.Contains(textmarker))
            {
                string tempValue = "";
                bool startText = false;

                List<string> temp = new List<string>();

                foreach (string v in values)
                {

                    /// <summary>
                    /// check if the value v contains a textmarker
                    /// and generate a new string which include all values between
                    /// the first Text marker and the last TextMarker
                    /// </summar>
                    /// <remarks></remarks>
                    if (v.Contains(textmarker))
                    {

                        if (v.ToCharArray().First().Equals(textmarker))
                        {
                            tempValue = v;
                            startText = true;
                        }

                        if (v.ToCharArray().Last().Equals(textmarker))
                        {
                            tempValue += separator+v;
                            temp.Add(tempValue.Trim(textmarker));
                            startText = false;
                        }

                    }
                    else
                    {
                        if (startText)
                            tempValue += separator + v;
                        else temp.Add(v);
                    }
                }

                return temp;
            }

            return values;
        }