15-04-常用对象API(String类-常见功能-获取_2)
2015-08-10 22:49
369 查看
package cn.itcast.string.demo; public class StringMethodDemo2 { public static void main(String[] args) { /* * 1.4获取字符串中的一部分字符串,也成为子串 * String substring(int beginIndex,int endIndex)//返回角标位置从beginIndex到endIndex-1的一个子串 * String substring(int beginIndex)//返回从beginIndex一直到最后的一个子串 */ stringMethodDemo_2(); } private static void stringMethodDemo_2() { String s = "abcdae"; System.out.println("substring:"+s.substring(2)); System.out.println("substring:"+s.substring(2,4)); } }
相关文章推荐
- 直方图均衡化原理和编码实现(C/C++)
- (一一六)新浪微博客户端的离线缓存实现思路
- openssl命令行Base64编解码
- atitit.系统架构图 的设计 与工具 attilax总结
- 《Windows核心编程》---Interlocked原子访问系列函数
- 15-03-常用对象API(String类-常见功能-获取_1)
- arm汇编的str指令
- 零基础学python-2.2 输入 input()
- ASP入门(五)- VBScript过程和函数
- atitit.系统架构图 的设计 与工具 attilax总结
- Emmet语法实例(帮助快速开发)
- 零基础学python-2.2 输入 input()
- react学习资源
- 控制台下输出包含中文的wchar_t字符串的方法
- linux简单cpu压力工具
- 15-02-常用对象API(String类-构造函数)
- 九度oj 1006
- mysql主从复制
- 详细介绍C/C++数组名与指针区别
- 程序员怎么一步步提高自己