public void Parse(string InText) { this.text = InText; this.sections = Regex.Split(this.text, RegexPattern); for (int i = 0; i < this.sections.Length; i++) { char[] trimChars = new char[] { '"' }; this.sections[i] = this.sections[i].Trim(trimChars); } if (this.sections.Length > 0) { this.baseCommand = this.sections[0]; } else { this.baseCommand = string.Empty; } if (this.sections.Length > 1) { this.arguments = LinqS.Skip(this.sections, 1); } else { this.arguments = null; } }
public void Parse(string InText) { text = InText; sections = Regex.Split(text, RegexPattern); // sections = sections.Where(x => !string.IsNullOrEmpty(x.Trim())).ToArray(); for (int i = 0; i < sections.Length; ++i) { sections[i] = sections[i].Trim('"'); } if (sections.Length > 0) { baseCommand = sections[0]; } else { baseCommand = ""; } if (sections.Length > 1) { arguments = LinqS.Skip(sections, 1); } else { arguments = null; } }