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
运行结果
上一篇:土豆丝怎么切又细又快?