0% found this document useful (0 votes)
5 views

String Methods

Uploaded by

kyravats13
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

String Methods

Uploaded by

kyravats13
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Method Description Return

Type

charAt() Returns the character at the specified index (position) char

compareTo() Compares two strings lexicographically int

compareToIgnoreCase( Compares two strings lexicographically, ignoring case int


) differences

concat() Appends a string to the end of another string String

endsWith() Checks whether a string ends with the specified boolean


character(s)

equals() Compares two strings. Returns true if the strings are boolean
equal, and false if not

equalsIgnoreCase() Compares two strings, ignoring case considerations boolean

indexOf() Returns the position of the first found occurrence of int


specified characters in a string

lastIndexOf() Returns the position of the last found occurrence of int


specified characters in a string

length() Returns the length of a specified string int

startsWith() Checks whether a string starts with specified boolean


characters

substring() Returns a new string which is the substring of a String


specified string

toLowerCase() Converts a string to lower case letters String

toUpperCase() Converts a string to upper case letters String

trim() Removes whitespace from both ends of a string String

valueOf() Returns the string representation of the specified value String

replace() Searches a string for a specified value, and returns a new string String
where the specified values are replaced

You might also like