多语言展示
当前在线:906今日阅读:197今日分享:19

java 字符串截取

java 字符串截取
工具/原料
1

电脑

2

idea\eclipse

方法/步骤
1

substring(beginIndex,endIndex )概述substring() 方法返回字符串的子字符串。参数beginIndex -- 起始索引(包括), 索引从 0 开始。endIndex -- 结束索引(不包括)。

2

使用DemoString Str = new String("www.runoob.com") System.out.print("返回值 :" ); System.out.println(Str.substring(4) ) System.out.print("返回值 :" ); System.out.println(Str.substring(4, 10) );

3

运行结果

推荐信息