I'm going trough old poorly designed comma separated data. For the most part each "section" is correctly separated by a comma:
string old_data = data_for_section_1,data_for_section_2,IDs|in|section|3
That is different for section 4, whose data is "comma white space" separated:
string old_data = data_for_section_1,data_for_section_2,IDs|in|section|3,section_4_part_1, section_4_part_2, section_4_part_3,data_for_section_5
Is it at all possible to get and feed the 5 sections into an array, and not end up with 7 items in that array?
I believe the following should work:
var data = Regex.Split(old_data, @",(?!\s)");
An example of this is here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.