How to split() a delimited string to a List

前端 未结 7 2335
被撕碎了的回忆
被撕碎了的回忆 2020-12-04 11:30

I had this code:

    String[] lineElements;       
    . . .
    try
    {
        using (StreamReader sr = new StreamReader(\"TestFile.txt\"))
        {
            


        
7条回答
  •  猫巷女王i
    2020-12-04 12:18

    string[] thisArray = myString.Split('/');//     
    List myList = new List(); //make a new string list    
    myList.AddRange(thisArray);    
    

    Use AddRange to pass string[] and get a string list.

提交回复
热议问题