private static string splitStr(String val, int s, int e, bool trim) { if (trim) { while (s < e && val[s] <= ' ') ++s; while (e > s && val[e-1] <= ' ') --e; } return val.Substring(s, e-s); }