string[] tokens = tokenSt.Split(',');
int cPos = -1;
int pPos = -1;
string lConnString = connectionString.ToLower(CultureInfo.CurrentCulture);
foreach (string token in Tokens)
{
cPos = lConnString .IndexOf(token);
if (cPos > pPos)
{
tokenPos = cPos;
tokenMPos = cPos + token.ToString().Length ;
pPos = cPos;
}
}
For future reference, please ask the question that you actually want answered. If you have existing code and you want help to make that work then say so, and post the existing code. Don't just ask how to use a particular class in general if want to know how to use it in a specific scenario. There's every chance that we would waste our time and yours by telling you things you already know and not telling you the things that you actually need. ALWAYS post a FULL and CLEAR explanation of the ACTUAL problem you want to solve.actually I am writing to resolve existing code issue where the code is looks like
SecureString
's. e.g. How to re-write the code if connectionString
or lConnString
were secure strings?SqlConnectionStringBuilder
or one of the other concrete DbConnectionStringBuilder
classes?