//把{"诸葛亮","鸟叔","卡卡西","卡哇伊"}变成诸葛亮|鸟叔|卡卡西|卡哇伊,然后再把|切割掉。 string[] names = { "诸葛亮" ,"鸟叔","卡卡西","卡哇伊"}; string str = string.Join("|", names); string []strNew=str.Split(new char[]{'|'},StringSplitOptions.RemoveEmptyEntries); Console.WriteLine(str); Console.WriteLine(strNew[0]); Console.ReadKey();
string s = "2008-08-08"; string[] date = s.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries); Console.WriteLine("{0}年{1}月{2}日", date[0], date[1], date[2]); Console.ReadKey();