zoukankan      html  css  js  c++  java
  • C# 字符串分割

     1 public string[] StringSplit(string strSource, string strSplit)
     2         {
     3             string[] strtmp = new string[1]; int index = strSource.IndexOf(strSplit, 0);
     4             if (index < 0) { strtmp[0] = strSource; return strtmp; }
     5             else
     6             {
     7                 strtmp[0] = strSource.Substring(0, index);
     8                 return StringSplit(strSource.Substring(index + strSplit.Length), strSplit, strtmp);
     9             }
    10         }
    11 
    12         private string[] StringSplit(string strSource, string strSplit, string[] attachArray)
    13         {
    14             string[] strtmp = new string[attachArray.Length + 1]; attachArray.CopyTo(strtmp, 0);
    15             int index = strSource.IndexOf(strSplit, 0);
    16             if (index < 0)
    17             {
    18                 strtmp[attachArray.Length] = strSource;
    19                 return strtmp;
    20             }
    21             else
    22             {
    23                 strtmp[attachArray.Length] = strSource.Substring(0, index);
    24                 return StringSplit(strSource.Substring(index + strSplit.Length), strSplit, strtmp);
    25             }
    26         }
    View Code
  • 相关阅读:
    DAY56
    DAY55
    DAY54
    DAY53
    DAY52
    DAY51
    DAY50
    spark1.1.0部署standalone分布式集群
    Storm流分组介绍
    Storm拓扑的并行度(parallelism)介绍
  • 原文地址:https://www.cnblogs.com/superdong/p/3107088.html
Copyright © 2011-2022 走看看