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

字符串截取字符串截取,substring,字符串substring

来源: javaer 分享于  点击 20713 次 点评:77

字符串截取字符串截取,substring,字符串substring


字符串截取,substring(int beginIndex) 返回一个新的字符串,它是此字符串的一个子字符串。是从第beginIndex位开始截取。
substring(int beginIndex, int endIndex) 返回一个新字符串,它是此字符串的一个子字符串。
beginIndex - 起始索引。(从0开始)
endIndex - 结束索引。
“helloworld”.substring(2) returns “lloworld”
“helloworld”.substring(4, 8) returns “oworl”

相关文章

    暂无相关文章

用户点评