Method Summary |
char |
charAt(int index) Returnschar Value. |
int |
codePointAt(int index) Returns the characters (UNICODE code points) at the specified index ). |
int |
codePointBefore(int index) Returns the character (UNICODE Code Point) before the specified index ). |
int |
codePointCount(int beginIndex, int endIndex) Return thisString Number of Unicode code points in the specified text range. |
int |
compareTo(String anotherString) Compares two strings in alphabetical order. |
int |
compareToIgnoreCase(String str) Compare two strings in alphabetical order, regardless of case. |
String |
concat(String str) Link the specified string to the end of the string. |
boolean |
contains(CharSequence s) True is returned only when this string contains the specified sequence of char values. |
boolean |
contentEquals(CharSequence cs) If and only whenStringReturns the same char value as the specified sequence.True. |
boolean |
contentEquals(StringBuffer sb) If and only whenStringIndicatesStringbufferReturns the same character sequence.True. |
static String |
copyValueOf(char[] data) Returns the string that represents the character sequence in the specified array. |
static String |
copyValueOf(char[] data, int offset, int count) Returns the string that represents the character sequence in the specified array. |
boolean |
endsWith(String suffix) Test whether the string ends with the specified suffix. |
boolean |
equals(Object anObject) Compare this string with the specified object. |
boolean |
equalsIgnoreCase(String anotherString) Set thisString With anotherString For comparison, case-insensitive. |
static String |
format(Locale l, String format, Object... args) Returns a formatted string using the specified language environment, format string, and parameter. |
static String |
format(String format, Object... args) Returns a formatted string using the specified format string and parameters. |
byte[] |
getBytes() Use the default Character Set of the platformStringDecodes the data into a byte sequence and stores the results in a new byte array. |
void |
getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin) Expired. This method cannot correctly convert characters into bytes. From JDK 1.1, the preferred method to complete the conversion is throughgetBytes() Constructor. This method uses the default Character Set of the platform. |
byte[] |
getBytes(String charsetName) Use the specified character setStringDecodes the data into a byte sequence and stores the results in a new byte array. |
void |
getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) Copy the character string to the target character array. |
int |
hashCode() Returns the hash code of this string. |
int |
indexOf(int ch) Returns the index of the first occurrence of the specified character in this string. |
int |
indexOf(int ch, int fromIndex) Searches from the specified index and returns the index at the specified character for the first time in this string. |
int |
indexOf(String str) Returns the index of the first occurrence of the specified substring in this string. |
int |
indexOf(String str, int fromIndex) Returns the index of the first occurrence of the specified substring from the specified index. |
String |
intern() Returns the canonicalized representation of string objects. |
int |
lastIndexOf(int ch) Returns the index of the last occurrence of the specified character in this string. |
int |
lastIndexOf(int ch, int fromIndex) Start Backward Search from the specified index, and return the index of the last occurrence of the specified character in this string. |
int |
lastIndexOf(String str) Returns the index of the rightmost substring in this string. |
int |
lastIndexOf(String str, int fromIndex) Searches backward from the specified index and returns the index of the specified sub-string that appears the last time in this string. |
int |
length() Returns the length of this string. |
boolean |
matches(String regex) Indicates whether the string matches the given regular expression. |
int |
offsetByCodePoints(int index, int codePointOffset) Return thisString Fromindex OffsetcodePointOffset Code points. |
boolean |
regionMatches(boolean ignoreCase, int toffset, String other, int ooffset, int len) Test whether the two string regions are equal. |
boolean |
regionMatches(int toffset, String other, int ooffset, int len) Test whether the two string regions are equal. |
String |
replace(char oldChar, char newChar) Returns a new string by usingnewChar Replace alloldChar . |
String |
replace(CharSequence target, CharSequence replacement) Replace this string with each substring that matches the target sequence of the literal value. |
String |
replaceAll(String regex, String replacement) Replace this string with the given replacement string to match each substring of the given regular expression. |
String |
replaceFirst(String regex, String replacement) Replace the string with the given replacement string to match the first substring of the given regular expression. |
String[] |
split(String regex) Splits the string based on the matching of the given regular expression. |
String[] |
split(String regex, int limit) Splits the string based on the given regular expression. |
boolean |
startsWith(String prefix) Test whether the string starts with the specified prefix. |
boolean |
startsWith(String prefix, int toffset) Test whether the string starts with the specified prefix. The prefix starts with the specified index. |
CharSequence |
subSequence(int beginIndex, int endIndex) Returns a new character sequence, a subsequence of this sequence. |
String |
substring(int beginIndex) Returns a new string, which is a substring of this string. |
String |
substring(int beginIndex, int endIndex) Returns a new string, which is a substring of this string. |
char[] |
toCharArray() Converts a string to a new character array. |
String |
toLowerCase() Use the rules of the default language environmentString All characters in are converted to lowercase letters. |
String |
toLowerCase(Locale locale) Use the givenLocale The ruleString All characters in are converted to lowercase letters. |
String |
toString() Returns the object itself (it is already a string !). |
String |
toUpperCase() Use the rules of the default language environmentString All characters in are converted to uppercase letters. |
String |
toUpperCase(Locale locale) Use the givenLocale The rule sets thisString All characters in are converted to uppercase letters. |
String |
trim() Returns a copy of the string, ignoring leading and trailing spaces. |
static String |
valueOf(boolean b) Returnboolean Parameter string representation. |
static String |
valueOf(char c) Returnchar Parameter string representation. |
static String |
valueOf(char[] data) Returnchar String Representation of array parameters. |
static String |
valueOf(char[] data, int offset, int count) Returnchar The string representation of the special sub-array of the array parameter. |
static String |
valueOf(double d) Returndouble Parameter string representation. |
static String |
valueOf(float f) Returnfloat Parameter string representation. |
static String |
valueOf(int i) Returnint Parameter string representation. |
static String |
valueOf(long l) Returnlong Parameter string representation. |
static String |
valueOf(Object obj) ReturnObject Parameter string representation. |