java深入理解字符串

第十一节、深入理解字符串

1 字符串处理

求子串。helloworld
String str="helloworld";
//5<= n <9
//str=str.substring(5, 10);
str=str.substring(0,5);

测试字符串是否相等。equals
	Object equals 等价于 == :比较内存地址 
	String equals:比较内容

	1,寄存器
	2,栈
	3,堆            *  new 
	4,静态存储区
	5,常量存储区    *  final static 
			     String常量池
	6,其他存储位置


	API 1.6
字符串编辑
	字符串的内容不会变的,改变的是引用
	String a="hello";
	a=a+"world";
	System.out.println(a);

2 字符串其他常用操作

学习查看API
发布了37 篇原创文章 · 获赞 19 · 访问量 865

猜你喜欢

转载自blog.csdn.net/qq_44867340/article/details/95782652