Java String Methods

You are Here:

Java String Methods

The following are the list of inbuilt string methods in Java programming.

MethodsExplanation
charAt()Returns the character at the given index in a string.
codePointAt()Returns the Unicode value of the character at the given index in a string.
codePointBefore()Returns the Unicode value of the character before the given index in a string.
codePointCount()Returns the number of Unicode values found between the given startIndex and endIndex in a string.
compareTo()Compares the characters of two strings (This method discriminates between lower case and upper case).
compareToIgnoreCase()Compares the characters of two strings (This method doesn't discriminates between lower case and upper case).
concat()Appends a string to the end of another string.
contains()Checks whether the substring occurs within a given string or not.
contentEquals()Compares the String with the String Buffer and returns a boolean value.
copyValueOf()Copies an array of characters to the string.
endsWith()Checks whether the specified string matches the end of the given string or not.
equals()Checks whether the two specified String objects have the same value or not.
equalsIgnoreCase()Checks whether the two specified String objects have the same value or not, irrespective of the case of the string.
format()Formats strings in a desired format by inserting objects and variables with specified padding into other strings.
getBytes()Encodes a specified String into a sequence of bytes using the named charset, storing the result into a new byte array.

Reminder

Hi Developers, we almost covered 90% of String functions and Interview Question on Java with examples for quick and easy learning.

We are working to cover every Single Concept in Java.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author