示例#1
0
        /// <summary> Searches for the next End-Of-Line. </summary>
        /// <returns> The the location in the string of the next End-Of-Line. </returns>
        private int FindNextEol()
        {
            int pos = 0;

            while (pos < _buffer.Length)
            {
                var escaped = _isEscaped.EscapedChar(_buffer[pos]);
                if (_buffer[pos] == CommandSeparator && !escaped)
                {
                    return(pos);
                }
                pos++;
            }
            return(pos);
        }
示例#2
0
        /// <summary> Removes all occurences of a specific character unless escaped. </summary>
        /// <param name="input">      The input. </param>
        /// <param name="removeChar"> The  character to remove. </param>
        /// <param name="escapeChar"> The escape character. </param>
        /// <returns> The string with all removeChars removed. </returns>
        public static string Remove(string input, char removeChar, char escapeChar)
        {
            var output  = string.Empty;
            var escaped = new IsEscaped();

            for (var i = 0; i < input.Length; i++)
            {
                char inputChar = input[i];
                bool isEscaped = escaped.EscapedChar(inputChar);
                if (inputChar != removeChar || isEscaped)
                {
                    output += inputChar;
                }
            }
            return(output);
        }
示例#3
0
        /// <summary> Searches for the next End-Of-Line. </summary>
        /// <returns> The the location in the string of the next End-Of-Line. </returns>
        private int FindNextEol()
        {
            int pos = 0;

            while (pos < _buffer.Length)
            {
                var escaped = _isEscaped.EscapedChar(_buffer[pos]);
                if (_buffer[pos] == EolDelimiter && !escaped)
                {
                    return(pos);
                }
                else
                {
                    pos++;
                }
            }
            return(pos);
        }
示例#4
0
 /// <summary> Removes all occurences of a specific character unless escaped. </summary>
 /// <param name="input">      The input. </param>
 /// <param name="removeChar"> The  character to remove. </param>
 /// <param name="escapeChar"> The escape character. </param>
 /// <returns> The string with all removeChars removed. </returns>
 public static string Remove(string input, char removeChar, char escapeChar)
 {
     var output = string.Empty;
     var escaped = new IsEscaped();
     for (var i = 0; i < input.Length; i++)
     {
         char inputChar = input[i];
         bool isEscaped = escaped.EscapedChar(inputChar);
         if (inputChar != removeChar || isEscaped)
         {
             output += inputChar;
         }
     }
     return output;
 }