String
1. Char charAt (int index) : Takes one of the characters in the string, where the argument index refers to the ordinal in the string. The ordinal number of the string starts from 0 to length ()-1 .
2. int CompareTo (string anotherstring) : The current String object is compared to anotherstring . The equality relationship returns 0; When unequal, the first unequal character difference is returned, starting with the 0 characters of the two strings, and in the other case, the earlier part of the longer string happens to be a shorter string, returning their length difference.
4. String concat (String str) : Connects the string object to str .
9. Boolean Equals (Object AnObject) : Returns truewhen anobject is not empty and is the same as the current String object; false.
int indexOf (int ch) : Only the first match character position is found.
int indexOf (int ch, int fromIndex) : Find the first matching character position starting from FromIndex .
. int indexOf (String str) : Only the first match string position is found.
indexOf Int (string str, int fromIndex) : Find the first match string position starting from FromIndex .
. int lastIndexOf (int ch)
int. int lastIndexOf (int ch, int fromIndex)
. int lastIndexOf (String str)
lastIndexOf Int (String str, int fromIndex) more than four methods are similar to the three, The difference is: find the last matching content.
. int length () : Returns the current string length.
String Replace (char OldChar, char Newchar) : Replaces the first OldChar in a character string with Newchar.
string substring (int beginindex) : Takes a substring from the beginindex position to the end.
26.String substring (int beginindex, int endIndex) : Takes substrings from the beginindex position to the endIndex position.
1), the string length obtained is:Endindex–beginindex;
2), starting from Beginindex , to the end of EndIndex , starting from 0 of the number, which does not include the endIndex position of the character ;
string toLowerCase () : Converts a string to lowercase.
String touppercase () : Converts a string to uppercase.
Publicstring Trim ()
Returns the string after which the string is stripped of the beginning and trailing spaces
Publicstring[] Split (String regex)
Separates a string by the specified delimiter, returning a delimited array of strings
Java String Common functions