I have the following snippet of code:
public static List<string> sqlData = new List<string>();
//
// lots of code here
//
if (/* check here to see if the sqlData[whatever] index exists */)
{
sqlData.Insert(count2, sqlformatted);
}
else
{
sqlData.Insert(count2, sqlformatted + sqlData[count2]);
}
What I want to know is how to check the index on sqlData to see if it exists before trying to insert something that contains itself.
If whatever is always positive then you can use this:
Or if whatever could also be negative then you need to add a test for that too: