cannot convert from 'string' to 'char[]' for split

前端 未结 7 1843

I am using the following code to split a string:

string sss=\"125asdasdlkmlkdfknkldj125kdjfngdkjfndkg125ksndkfjdks125\";

List s = new List<         


        
7条回答
  •  既然无缘
    2020-12-11 01:43

    You can just create a char []:

     List s = new List(sss.split(new char[] {'1', '2', '5'}))
    

    or

     List s = new List(sss.split("125".ToCharArray()));
    

    More information: http://msdn.microsoft.com/en-us/library/ezftk57x.aspx

提交回复
热议问题