C# – Parsing CSV data when a field has commas

When you have commas in your CSV fields, it creates a conflict with the field delimiting commas. In other words, you can’t tell which data belongs to which field. How you deal with this will depend on one question: is the field with the comma enclosed in quotes? Comma is enclosed in quotes Spreadsheet programs … Read more

C# – Parse a comma-separated string from app.config

I’ll show how to parse comma-separated integer values from app.config and load them into a HashSet for efficient lookups. First, take a look at the setting (retryStatusCodes) in app.config: To load and parse this setting from app.config, do the following: The following code shows how to do this: Note: You have to add a reference … Read more