Java.lang class String

Source: Internet
Author: User

Method Summary
1 Char
    charAt(int index)

Returned at the specified index.charValue.
index-charThe index of the value.
2 string
concat(String str)
Connects the specified string to the end of this string.
str-Connect to thisStringEnd ofString。

substring(int beginIndex)
Returns a new string that is a substring of this string.
beginIndex-Start index (included).
3 Boolean
endsWith(String suffix)
Tests whether this string ends with the specified suffix.
suffixSuffix

startsWith(String prefix)
Tests whether this string starts with the specified prefix.

equals(Object anObject)
Compares this string to the specified object.
anObject-With thisStringObjects to compare with

equalsIgnoreCase(String anotherString)
Add thisStringwith anotherStringComparisons, regardless of case.
anotherString-With thisStringTo compare theString。

4 int
indexOf(int ch)
Returns the index at which the specified character first appears in this string.
ch-One character

indexOf(int ch, int fromIndex)
Returns the index at the first occurrence of the specified character in this string, starting the search from the specified index.
ch-One characterfromIndex-the index at which to start the search.

indexOf(String str)
Returns the index at which the specified substring first appears in this string.
str-arbitrary string

indexOf(String str, int fromIndex)
Returns the index of the first occurrence of the specified substring in this string, starting at the specified index.
str-substring to search for.fromIndex-The index location at which to start the search.
public intlastIndexOf(int ch)
public intlastIndexOf(iint ch, int fromIndex)
public intlastIndexOf(String str)
public intlastIndexOf(String str, int fromIndex)

length()
Returns the length of this string.

To be continued .....

Java.lang class String

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.