private unsafe int EndOfString()

in Microsoft.Shared.Dna.Json/JsonParser.cs [917:945]


        private unsafe int EndOfString(char* payloadPointer)
        {
            int result = this.position + 1;
            bool escaped = false;
            while (result < this.payloadLength)
            {
                char c = *(payloadPointer + result);
                result++;
                if (escaped)
                {
                    escaped = false;
                }
                else
                {
                    if (c == JsonConstants.StringEnclosure)
                    {
                        return result;
                    }

                    if (c == JsonConstants.CharacterEscape)
                    {
                        escaped = true;
                        this.decode = true;
                    }
                }
            }

            return -1;
        }