CSV string handling

后端 未结 13 890
北荒
北荒 2020-12-28 16:44

Typical way of creating a CSV string (pseudocode):

  1. Create a CSV container object (like a StringBuilder in C#).
  2. Loop through the strings you want to ad
13条回答
  •  长情又很酷
    2020-12-28 17:04

    Why not use one of the open source CSV libraries out there?

    I know it sounds like overkill for something that appears so simple, but as you can tell by the comments and code snippets, there's more than meets the eye. In addition to handling full CSV compliance, you'll eventually want to handle both reading and writing CSVs... and you may want file manipulation.

    I've used Open CSV on one of my projects before (but there are plenty of others to choose from). It certainly made my life easier. ;)

提交回复
热议问题