string AAAAA= "ABCD1234";
//取出字符串中所有的英文字母
string strSplit1 = Regex.Replace(AAAAA, "[a-z]", "", RegexOptions.IgnoreCase);
//取出字符串中所有的數字
string strSplit2 = Regex.Replace(AAAAA, "[0-9]", "", RegexOptions.IgnoreCase);
獲取的結果:strSplit1 =“1234“,strSplit2 =“ABCD”