public static List split(string self, Long separator, bool trim)
{
if (separator == null)
{
return(splitws(self));
}
int sep = separator.intValue();
List toks = new List(Sys.StrType, 16);
int len = self.Length;
int x = 0;
for (int i = 0; i < len; ++i)
{
if (self[i] != sep)
{
continue;
}
if (x <= i)
{
toks.add(splitStr(self, x, i, trim));
}
x = i + 1;
}
if (x <= len)
{
toks.add(splitStr(self, x, len, trim));
}
return(toks);
}