C# string split

如: string str = "abc123;";

      int i=0;

      for(string s in str.split(';'))

      {

          i++;

      }

     输出结果为2

     分析:"abc123;" 使用";"分割 被分割为两个部分 分别为"abc123"和""

     如果在循环中使用 s进行判断  注意过来空的情况

原文地址:https://www.cnblogs.com/Mander/p/4815235.html