2011年10月12日

C# 几个经常用到的字符串的截取。

摘要: string str="123abc456";int i=3;1 取字符串的前i个字符 str=str.Substring(0,i); // or str=str.Remove(i,str.Length-i); 2 去掉字符串的前i个字符: str=str.Remove(0,i); // or str=str.Substring(i); 3 从右边开始取i个字符: str=str.Substring(str.Length-i); // or str=str.Remove(0,str.Length-i);4 从右边开始去掉i个字符: str=str.Substring(0,s 阅读全文

posted @ 2011-10-12 16:43 Delphi2010_老赵 阅读(446) 评论(0) 推荐(0) 编辑

导航