//从前第一个字符开始截取 截取的长度为4 string Year =PressDate.Substring(0,4); //截取年 //从 “/”后面开始截取 string Month = PressDate.Substring(PressDate.LastIndexOf("/") + 1); //截取月 String str = "我们是程序员,我们很喜欢安静的做程序,这是我们的特点"; String subStr = str.substring(str.indexOf("很")+1, str.indexOf("点")); 截取年月日 string strtempy= "年"; string strtempm = "月"; int IndexofA = mintime.IndexOf(strtempy); int IndexofB = mintime.IndexOf(strtempm); string Month = mintime.Substring(IndexofA + 1, IndexofB - IndexofA - 1);