Here's a function that might work. I'm messing around with .Net and both VB and C#. My nephew wrote this routine.
static string[] Split(string expression, string delimiter,
string qualifier, bool ignoreCase)
{
bool _QualifierState = false;
int _StartIndex = 0;
System.Collections.ArrayList _Values = new System.Collections.ArrayList();
for (int _CharIndex = 0; _CharIndex < expression.Length ; _CharIndex++)
{
if ((qualifier != null) & (string.Compare(expression.Substring(_CharIndex, qualifier.Length), qualifier, ignoreCase) == 0))
{
_QualifierState = !(_QualifierState);
}
else if (!(_QualifierState) & (delimiter != null) & (string.Compare(expression.Substring(_CharIndex, delimiter.Length), delimiter, ignoreCase) == 0))
{
_Values.Add(expression.Substring(_StartIndex, _CharIndex - _StartIndex));
_StartIndex = _CharIndex + 1;
}
}
if (_StartIndex <= expression.Length)
_Values.Add(expression.Substring(_StartIndex, expression.Length - _StartIndex));
string[] _returnValues = new string[_Values.Count];
_Values.CopyTo(_returnValues);
return _returnValues;
}
Maybe the code will help you out. Sorry about the formatting.