public static int QuotedIndexOf(string text,char indexChar)
{
int retVal = -1;
bool inQuotedString = false; // Holds flag if position is quoted string or not
for(int i=0;i<text.Length;i++){
char c = text[i];
if(c == '\"'){
// Start/end quoted string area
inQuotedString = !inQuotedString;
}
// Current char is what index we want and it isn't in quoted string, return it's index
if(!inQuotedString && c == indexChar){
return i;
}
}
return retVal;
}