http://www.cnblogs.com/xiaobaigang/archive/2007/09/24/904513.html
private string GetString(string data, string FindStr, string EndStr)
{
Match m = Regex.Match(data, "(?:" + ReplaceChar(FindStr) + @")([\w\W]*?)" + ReplaceChar(EndStr));
return m.Groups[1].ToString();
}
使用方法如:
string str="abcdefghijglmn";
GetString(str,"bc","hi"); 将得到 "defg" 也就是得到FindStr和EndStr之间的字符串
string s1="cdeeacdf";//按顺序转化成 accddeef
char[] arr=s1.ToCharArray();
Array.Sort(arr);
string t = "";
for(int i= 0;i<arr.Length ;i++)
{ t += arr[i]; }
Response.Write(s1 + "<br>t:" + t);
Response.End();
string aa="abcdef";//输出字母用逗号分开
char [] ab=aa.ToCharArray();
aa = "";
int num = 0;
foreach(char a in ab)
{
aa += ((num==0)?(""):(",")) + a.ToString();
++num;
}
Response.Write(aa);
Response.End();