c#读取csv,数据有多个引号该怎么做?

2025-04-01 16:50:08
推荐回答(1个)
回答(1):

不太明白你的意思,其实这种数据很好解析啊,你只需要按照分号进行split一下,然后就拿到各个数据了,想要干啥都可以了。。

   static void Main(string[] args)
        {
            string str = "1074,东城区,天坛街道,金鱼池中区社区,超市,金鱼池中区社区市民学校,\"金鱼池中区社区地下活动中心\",100050,67023463,免费领取书籍,\"周一至周五9:00——11:30,14:00——17:00\"";
            string[] allStrs = str.Split(',');
            foreach (string s in allStrs)
                Console.WriteLine(s + " ");

        }


有问题 可以继续讨论。。加油!!