上课学了一些字符串类的用法:
String str="helloworld";
1.字符串长度:str.length();
2.比较两个字符串的内容是否一致:
str.equals("hello");
1)不考虑大小写问题:
str.equalsIgnoreCase();
2)全用小写表示:
str.toLowerCase();
3)全用大写表示:
str.toUpperCase();
3.字符串连接
1)String str="123"+"456";
2)str.concat("456");
4.字符串提取
str.substring