ewefr

C#-字串操作

張貼者: Tony 2011年10月20日 星期四

字串陣列宣告

string[] array = new string[] { "A""B""C""D""E" }; 
string[] array = "A""B""C""D""E" }; 

字串轉字串陣列、字串陣列轉字串

string[] d = "1,2,3".Split(',');
string f = String.Join(",", d);

字串陣列轉List
List<string> listStr = new List<string>(array);

字串陣列委派
var days = Array.FindAll(array,match);

public static bool match(string str)
{
if (str == "A")
return true;
if (str == "B")
return true;

return false;
}  

List委派
var days = listStr.FindAll(match);

public static bool match(string str)
{
if (str == "A")
return true;
if (str == "B")
return true;

return false;
} 

0 意見

張貼留言

The Will Will Web

技術分享
MVP版主

重灌狂人

資訊分享

wowboxBlog

提供網頁設計相關資訊

KingKong Bruce記事

技術分享

C# Examples

csharp相關技術與範例

黑暗執行緒

技術分享
MVP版主

杨延成

技術分享
作者文章對於EF有詳細介紹

月光下的嘆息

工具分享
介紹許多好用的工具程式

Dot blogs

DotNet

格子樑/艾倫郭

技術分享
MVP版主