熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

字符串拆分split

2013-11-13 09:49:57  來源: .NET編程 

  public static void output()

  {

  String s = aabbcc dd ee;

  const char comma = ;

  const char space = ;

  char[] schar = new char[]

  {

  comma

  space

  };

  foreach (String s in sSplit(schar))

  {

  ConsoleWriteLine(s);

  }

  }

  foreach (String s in sSplit(schar))也可以直接寫foreach (String s in sSplit( ))

  Split()使用params參數不限定的


From:http://tw.wingwit.com/Article/program/net/201311/11690.html
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.