构造方法(☆☆☆☆☆)
String s = "abc"; : s就是String的一个对象
public String():空构造
public String(byte[] bytes):把字节数组转成字符串
public String(byte[] bytes,int index,int length):把字节数组的一部分转成字符串
public String(char[] value):把字符数组转成字符串
public String(char[] value,int index,int count):把字符数组的一部分转成字符串
public String(String original):把字符串常量值转成字符串
boolean contains(String str):判断大字符串中是否包含小字符串
boolean startsWith(String str):判断字符串是否以某个指定的字符串开头
boolean endsWith(String str):判断字符串是否以某个指定的字符串结尾
boolean isEmpty():判断字符串是否为空。
String的获取功能(☆☆☆☆☆)
int length():获取字符串的长度。
char charAt(int index):获取指定索引位置的字符
int indexOf(int ch):返回指定字符在此字符串中第一次出现处的索引。
int indexOf(String str):返回指定字符串在此字符串中第一次出现处的索引。
int indexOf(int ch,int fromIndex):返回指定字符在此字符串中从指定位置后第一次出现处的索引。
int indexOf(String str,int fromIndex):返回指定字符串在此字符串中从指定位置后第一次出现处的索引。
int lastIndexOf(int ch):从最后往前数返回指定字符在此字符串中第一次出现处的索引。
int lastIndexOf(String str):从最后往前数返返回指定字符串在此字符串中第一次出现处的索引。
int lastIndexOf(int ch,int fromIndex):返回指定字符在此字符串中从指定位置往前数第一次出现处的索引。
int lastIndexOf(String str,int fromIndex):返回指定字符串在此字符串中从指定位置往前数第一次出现处的索引。