private string GetValueString(string s, ref int pos)
{
int nq = s.IndexOf('\"', pos);
int nn = s.IndexOf(NullString, pos);
if (nn > 0 && nn < nq) return null;
int nsp = s.IndexOf(':', pos);
if (nsp != -1)
{
//pos = nsp + 2;
pos = nsp + 1;
}
int nt = s.IndexOfAny(new char[] { '}', ',' }, pos);
if (nt < nq || (nq == -1 && nt != -1))
{
string rv = s.Substring(pos, nt - pos);
pos = nt + 1;
return rv;
}
return GetNextQuotedString(s, ref pos);
}