private void Tokenize()
{
string tempstr = this.source;
string toks = "";
if (tempstr.IndexOfAny(this.delimiters.ToCharArray()) < 0 && tempstr.Length > 0)
{
this.elements.Add(tempstr);
}
else if (tempstr.IndexOfAny(this.delimiters.ToCharArray()) < 0 && tempstr.Length <= 0)
{
return;
}
while (tempstr.IndexOfAny(this.delimiters.ToCharArray()) >= 0)
{
if(tempstr.IndexOfAny(this.delimiters.ToCharArray()) == 0)
{
if (tempstr.Length > 1 )
{
this.elements.Add(tempstr.Substring(0,1));
tempstr=tempstr.Substring(1);
}
else
tempstr = "";
}
else
{
toks = tempstr.Substring(0,tempstr.IndexOfAny(this.delimiters.ToCharArray()));
this.elements.Add(toks);
this.elements.Add(tempstr.Substring(toks.Length,1));
if ( tempstr.Length > (toks.Length + 1))
{
tempstr = tempstr.Substring(toks.Length + 1);
}
else
tempstr = "";
}
}
if (tempstr.Length > 0)
{
this.elements.Add(tempstr);
}
}