1
public String substring(int beginIndex, int endIndex)
Returns a string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.
Examples:
“hamburger”.substring(4, 8) returns “urge”
“smiles”.substring(1, 5) returns “mile
2
String to char arrayString aString = "abc";
char[] array = aString.toCharArray();
int n = aString.length();
char a = aString.charAt(0); // return 'a'
char array to StringString s = new String(charArray);orString s = String.valueOf(charArray);
3StringBuilder sb = new StringBuilder();
sb.length();
sb.append("abc");
sb.deleteCharAt(0);
sb.reverse();
4
split methods1 = "asdf.asdf"
String[] str1 = s1.split("\\.");
5
String can not have the following:charAt(3) = charAt(5); // it is wrong