Iaik.Utils.SimpleFormatter.FindNextNotEscaped C# (CSharp) Method

FindNextNotEscaped() private method

Finds the next not escaped character (tofind)
private FindNextNotEscaped ( int offset, string findIn, string toFind ) : int
offset int
findIn string
toFind string
return int
        private int FindNextNotEscaped(int offset, string findIn, string toFind)
        {
            bool done = false;

            while (!done) {
                int index = findIn.IndexOf (toFind, offset);

                if (index == -1 || index == 0)
                    return index;

                if (findIn[index - 1] != '\\')
                    return index;
                else
                    offset = index + 1;
            }

            return -1;
        }