コード例 #1
0
        /// <summary> Clean line. </summary>
        /// <param name="line"> The line. </param>
        /// <returns> . </returns>
        private string CleanLine(string line)
        {
            var cleanedLine = line.Trim('\r', '\n');

            cleanedLine = Escaping.Remove(cleanedLine, _commandSeparator, _escapeCharacter);

            return(cleanedLine);
        }
コード例 #2
0
        /// <summary> Parse message. </summary>
        /// <param name="line"> The received command line. </param>
        /// <returns> The received command. </returns>
        private ReceivedCommand ParseMessage(string line)
        {
            // Trim and clean line
            var cleanedLine = line.Trim('\r', '\n');

            cleanedLine = Escaping.Remove(cleanedLine, _commandSeparator, _escapeCharacter);

            return
                (new ReceivedCommand(Escaping.Split(cleanedLine, _fieldSeparator, _escapeCharacter,
                                                    StringSplitOptions.RemoveEmptyEntries)));
        }