asp.net将CSV字符串转换为字符串[] [英] asp.net Convert CSV string to string[]

查看:64
本文介绍了asp.net将CSV字符串转换为字符串[]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法可以将字符串从csv格式转换为字符串[]或列表?

Is there an easy way to convert a string from csv format into a string[] or list?

我可以保证数据中没有逗号.

I can guarantee that there are no commas in the data.

推荐答案

string[] splitString = origString.Split(',');

(以下为原始答复者未添加的评论) 请记住,此答案是针对特定情况的,在这种情况下,数据中肯定没有逗号.

这篇关于asp.net将CSV字符串转换为字符串[]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆