private void ProcessValue(String value) { // this Option has a separator character if (Option.HasValueSeparator()) { // get the separator character char sep = Option.ValueSeparator; // store the index for the value separator int index = value.IndexOf(sep); // while there are more value separators while (index != -1) { // next value to be added if (values.Count == (Option.ArgumentCount - 1)) { break; } // store Add(value.Substring(0, index)); // parse value = value.Substring(index + 1); // get new index index = value.IndexOf(sep); } } // store the actual value or the last value that has been parsed Add(value); }