将字符串数组(string [])添加到List< string> C# [英] Adding string array (string[]) to List<string> c#

查看:853
本文介绍了将字符串数组(string [])添加到List< string> C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当将string [],_ lineParts添加到列表中时,我在列表中看到的只是"System.String []" 要查看列表中的实际string []值,需要做些什么.

When the string[], _lineParts is added to the List, all I see in the List is "System.String[]" What needs to be done to see the actually string[] values in the list.

while (_aLine != null) 
{ 
    //split the line read into parts delimited by commas 
    _lineParts = _aLine.Split(new char[] { ' ', '\u000A', ',', '.', ';', ':', '-', '_', '/' }, 
        StringSplitOptions.RemoveEmptyEntries); 
    //keep things going by reading the next  line 
    _aLine = sr.ReadLine(); 
    //words = _lineParts; 
    if (_lineParts != null) 
    { 
        //_words.Add(_lineParts.ToString()); 
        wrd.Add(_lineParts.ToString()); 
    } 
} 

推荐答案

使用 查看全文

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