private IList <int> Split(String str) { IList <int> result = new List <int>(); if (str == null) { return(null); } IList <String> list = TagUtils.SplitValueList(str); for (int i = 0; i < list.Count; i++) { try{ result.Add(int.Parse(list[i])); } catch { //TODO, check what } } return(result); }
//clean this write new tokenizer IList <String> SplitPath(String path) { if (path.Trim().Length == 0) { return(null); } StringBuilder buffer = new StringBuilder(); buffer.Append(path[0]); for (int i = 1; i < path.Length; i++) { //add a space between the letters and the numbers if ((Char.IsLetter(path[i - 1]) && !Char.IsLetter(path[i])) || (!Char.IsLetter(path[i - 1]) && Char.IsLetter(path[i]))) { buffer.Append(' '); } buffer.Append(path[i]); } return(TagUtils.SplitValueList(buffer.ToString())); }