欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > > 文章正文

Substring 的一些简单用法,Substring简单用法

来源: javaer 分享于  点击 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个字母.

相关文章

    暂无相关文章

用户点评