Substring 的一些简单用法,Substring简单用法
分享于 点击 10374 次 点评:142
Substring 的一些简单用法,Substring简单用法
string testString = abc:def;
testString.Substring( 2 ); // return c:def;
testString.Substring( testString.LastIndexOf( ":" ) + 1 ); //return def
testString.Substring( testString.LastIndexOf( ":" ) ); //return def:
testString.Substring( 2, 3 ); // return c:d 从0开始算, 到第2个字符(即第3个字母),共截取3个字母.
相关文章
- 暂无相关文章
用户点评