上海胸科医院呼吸内科:C# 一个字符/数组问题。

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/27 22:13:16
字符串: 123,223,565,565l,32323,23123421
转为数组:
[1] 123
[2] 223
[3] 565
……
以逗号分隔形成数组,如何实现?

string a="123,223,565";
string[] str_id=a.Split(',');
则:
str_id[0]="123";
str_id[1]="223";
str_id[2]="565";

使用Split方法