private static unsafe int FindSection(string format, int section)
{
int src;
char ch;
if (section == 0)
return 0;
fixed (char* pFormat = format)
{
src = 0;
for (;;)
{
switch (ch = pFormat[src++])
{
case '\'':
case '"':
while (pFormat[src] != 0 && pFormat[src++] != ch)
;
break;
case '\\':
if (pFormat[src] != 0)
src++;
break;
case ';':
if (--section != 0)
break;
if (pFormat[src] != 0 && pFormat[src] != ';')
return src;
goto case '\0';
case '\0':
return 0;
}
}
}
}