🌐
W3Schools
w3schools.com › java › java_ref_string.asp
Java String Methods
close() delimiter() findInLine() findWithinHorizon() hasNext() hasNextBoolean() hasNextByte() hasNextDouble() hasNextFloat() hasNextInt() hasNextLine() hasNextLong() hasNextShort() locale() next() nextBoolean() nextByte() nextDouble() nextFloat() nextInt() nextLine() nextLong() nextShort() radix() reset() useDelimiter() useLocale() useRadix() Java File Methods Java FileInputStream Java FileOutputStream Java BufferedReader Java BufferedWriter Java Iterator Methods Java Collections Methods Java System Methods Java Errors & Exceptions · Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&A ... The String class has a set of built-in methods that you can use on strings.
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-string-methods
Java String Methods - GeeksforGeeks
Java String methods are built-in functions provided by the String class to perform various operations on strings. These methods help in manipulating, comparing, searching, and formatting text efficiently.
Published: May 30, 2026
Discussions

Java String Methods - You Need To Know

First method of the article is charAt... Great start! Then you realise this is probably every method available order alphabetically... This could be reduce to a "5 methods to know" to be really interesting.

More on reddit.com
🌐 r/programming
1
0
October 6, 2018
ELI5:What is a "String" in Java/programming and why is it known as a "complex added type" and other variable are known as "primitive" ?
In simplest terms, a String is an collection (referred to in programming as an "array") of characters. If you wanted to have a String that said "Reddit", it would literally be an array of character values ['R', 'e', 'd', 'd', 'i', 't']. The most fundamental difference between strings and primitive types such as "int" are that primitives are single values. Strings are collections of values (specifically, a collection of characters.) Characters themselves are primitive types. In addition, primitive types are pieces of data. Strings are objects, which are instances of classes. As far as classes go...basically, the people who made Java built a lot of code so Strings could be easy to use by programmers. (This is also why "String" is capitalized: the name of the class has a capital S.) Sorry if this is too technical...but it should answer your questions. More on reddit.com
🌐 r/explainlikeimfive
5
1
November 21, 2015
New Methods on Java Strings With JDK 11

Looks like they're taking the awful PHP "real_escape_string" approach to API development of finding increasingly strained synonyms when something needs to be fixed by making the Unicode-aware version of String.trim() be named String.strip() instead of just adding an overload for trim() that takes an option parameter to specify the trimming type.

A hypothetical alternative of trim(StringTrimOptions options), used as in these examples:

// First two are equivalent, and use the backward-compatible
// pre-existing trimming logic
str.trim();
str.trim(StringTrimOptions.ASCII_WHITESPACE);

// This example uses new Unicode-compatible trimming logic.
str.trim(StringTrimOptions.UNICODE_WHITESPACE);

... would be a much better solution that wouldn't require every developer going forward, in perpetuity, to have to discover what the non-obvious difference between trim() and strip() is (whereas the hypothetical StringTrimOptions alternative is self-explanatory to a large extent); and is forward-compatible should the need ever arise in the future for yet another type of string trimming.

(And with the isBlank() method being added too, which could probably also benefit from being able to specify the type of whitespace; maybe instead of StringSplitOptions the argument should be WhitespaceType instead so an overload ofisBlank() could read correctly with it too.)

More on reddit.com
🌐 r/programming
16
30
May 3, 2018
New Methods on Java Strings With JDK 11
Sure, there could be a nice validation utility in the JDK for this. But not on String. ... That's certainly another way around it, but it's still not the direct, simple method that it should be. Moreover, I imagine the overhead is quite significant using Scanner, but I'm not sure. Thanks for letting me know Scanner could be used on string vars though. I wasn't aware of this until now. ... I'd rather have a "test-and-convert" like C# has. ... Yes! That would be even nicer. Please Java... More on reddit.com
🌐 r/java
74
110
May 3, 2018
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › String.html
String (Java Platform SE 8 ) - Oracle Help Center
July 21, 2026 - The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings. String concatenation is implemented through the StringBuilder(or StringBuffer) class and its append method. String conversions are implemented through the ...
🌐
W3Schools
w3schools.com › java › java_strings.asp
Java Strings
A String in Java is actually an object, which means it contains methods that can perform certain operations on strings.
🌐
Crio
crio.do › blog › string-methods-in-java
10 Important String Methods In Java You Must Know
October 20, 2022 - Useful and important methods in Java. indexOf, toCharArray, charAt, concat, replace, substring, split, compareTo, strip, valueOf
🌐
Programiz
programiz.com › java-programming › library › string
Java String Methods | Programiz
Java has a lot of String methods that allow us to work with strings. In this reference page, you will find all the string methods available in Java.
🌐
DEV Community
dev.to › pankaj_singhr › 10-most-useful-string-methods-in-java-4lag
🎯 10 most useful string methods in Java - DEV Community
January 19, 2022 - 1 - indexOf() used to find characters and substrings in a string. It returns the index of first occurrence from left of the passed string or character syntax - public int indexOf​(String str, int fromIndex) str - substring to be search fromIndex - search begin from this index
🌐
Codecademy
codecademy.com › learn › spring-apis-java-ii › modules › learn-java-string-methods › cheatsheet
Java II: String Methods Cheatsheet | Codecademy
This method returns a String representing the text of the combined strings. ... In Java, the equals() string method tests for equality between two Strings.
Find elsewhere
🌐
BeginnersBook
beginnersbook.com › 2013 › 12 › java-strings
Java – String Class and Methods with examples
int codePointAt(int index):It is similar to the charAt method however it returns the Unicode code point value of specified index rather than the character itself. I have shared several tutorials on the String in java.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › string methods java: a guide to java strings with examples
String Methods Java: A Guide To Java Strings With Examples
October 24, 2024 - static String valueOf(int value)- It is an overloaded method to convert the given type into a string. Let us check some examples of string functions in Java.
🌐
WsCube Tech
wscubetech.com › resources › java › string-methods
Java String Methods/Functions: Full List With Examples
3 weeks ago - Learn Java String Methods with examples. Explore the list of String functions, syntax, common operations & practical programs to master String methods in Java.
🌐
Software Testing Help
softwaretestinghelp.com › home › java › java string methods tutorial with examples
Java String Methods Tutorial With Examples
April 1, 2025 - Given below is the program that will demonstrate how the charAt() method retrieves a particular character from the given String. In this program, we have taken a String called “java string API” and we will try to retrieve the characters present at different indexes.
🌐
Tutorial Gateway
tutorialgateway.org › java-string-methods
Java String methods
June 11, 2026 - The String Methods perform various operations, including string comparison, search, copy, extracting a substring, converting to lowercase or uppercase, and so on. A string is an immutable object that represents a sequence of characters. Once a string is created, it can’t be changed.
🌐
Tutorialspoint
tutorialspoint.com › java › java_strings.htm
Java - String Class
Note − The String class is immutable, so that once it is created a String object cannot be changed. If there is a necessity to make a lot of modifications to Strings of characters, then you should use String Buffer & String Builder Classes. Methods used to obtain information about an object are known as accessor methods.
🌐
ScholarHat
scholarhat.com › home
What is String in Java - Java String Methods & Type (Examples)
Strings are immutable, meaning once created, their values cannot be changed. Java provides powerful built-in methods for string manipulation, such as concatenation, comparison, substring extraction, and pattern matching.
Published: August 30, 2025
🌐
Cogentuniversity
cogentuniversity.com › post › methods-of-strings-class-in-java
Methods of Strings Class in Java
October 30, 2023 - Methods in Java are functions that perform specific tasks. The String class, being an integral part of Java, boasts a plethora of methods tailored to handle strings efficiently. These methods enable developers to manipulate strings, extract information, and transform data according to their programming needs.
🌐
Runestone Academy
runestone.academy › ns › books › published › csjava › Unit2-Using-Objects › topic-2-7-string-methods.html
2.7. String Methods — CS Java
Trying to call a method like indexOf on a string reference that is null. You will get a null pointer exception. Using == to test if two strings are equal. This is actually a test to see if they refer to the same object. Usually you only want to know if they have the same characters in the same order. In that case you should use equals or compareTo instead. Treating upper and lower case characters the same in Java.
🌐
Medium
beknazarsuranchiyev.medium.com › string-class-and-its-methods-in-java-147b7aedc3a9
String class and its methods in Java | by Beknazar | Medium
June 15, 2022 - Consider using StringBuilder instead and converting to String after the loop. Because every time you reassign your string you are creating a new object in the memory. The string is the final class and we cannot extend the final classes. The methods provided by the String class can be used to manipulate its value.
🌐
Medium
medium.com › @dhanushahasheel › string-methods-in-java-83a601f5b2ef
String Methods in JAVA. - by Dhanusha Hasheel
November 6, 2025 - String Methods in JAVA · Java provides a variety of built-in features for the String class to help us implement and analyze strings effectively and efficiently. · The following string methods are …
🌐
Medium
medium.com › @salvipriya97 › commonly-used-string-functions-in-java-343543b06132
Commonly used String functions in Java | by Priya Salvi | Medium
January 3, 2024 - The String class in Java is part of the java.lang package and represents a sequence of characters. Strings in Java are immutable, meaning their values cannot be changed once they are created. The String class provides various methods for manipulating and extracting information from strings.