public static List splitws(String val)
{
List toks = new List(Sys.StrType, 16);
int len = val.Length;
while (len > 0 && val[len-1] <= ' ') --len;
int x = 0;
while (x < len && val[x] <= ' ') ++x;
for (int i=x; i<len; ++i)
{
if (val[i] > ' ') continue;
toks.add(val.Substring(x, i-x));
x = i + 1;
while (x < len && val[x] <= ' ') ++x;
i = x;
}
if (x <= len) toks.add(val.Substring(x, len-x));
if (toks.sz() == 0) toks.add("");
return toks;
}