Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Sign In
▲
Similar Topics
DSA
22.5k+ articles
Java
10.5k+ articles
Java-Functions
4.1k+ articles
Strings
3.2k+ articles
Java Programs
1.9k+ articles
Java-lang package
390+ articles
Java Examples
230+ articles
Java-String-Programs
130+ articles
java-regular-expression
90 articles
java-StringBuffer
37 articles
Java-Strings
220+ posts
Popular Articles
Recent Articles
Java Program to Check Whether the String Consists of Special Characters
Last Updated: 28 November 2024
In Java, special characters refer to symbols other than letters and digits, such as @, #, !, etc. To check whether the String consists of sp
...read more
Java
Technical Scripter
Java-Strings
Java Programs
Picked
Java-String-Programs
String Class repeat() Method in Java with Examples
Last Updated: 28 January 2021
The string can be repeated N number of times, and we can generate a new string that has repetitions. repeat() method is used to return Strin
...read more
Java
Technical Scripter
Java-Strings
Java Programs
Picked
Java 8
Technical Scripter 2020
String Constant Pool in Java
Last Updated: 22 July 2024
In Java, Strings are the type of objects that can store the character of values. A string acts the same as an array of characters in Java. M
...read more
Strings
Java
Java-Strings
Programming Language
DSA
Similar Topics
DSA
22.5k+ articles
Java
10.5k+ articles
Java-Functions
4.1k+ articles
Strings
3.2k+ articles
Java Programs
1.9k+ articles
Java-lang package
390+ articles
Java Examples
230+ articles
Java-String-Programs
130+ articles
java-regular-expression
90+ articles
java-StringBuffer
37+ articles
Program to check if the String is Null in Java
Last Updated: 27 November 2024
In Java, checking if a string is null is essential for handling null-safe conditions and preventing runtime errors. To check if a string is
...read more
Java
Java-Strings
Java Programs
Java-String-Programs
How to Convert a String to an int in Java?
Last Updated: 25 November 2024
In Java, converting a String to an int is done using methods from the Integer class. The methods used for this conversion are Integer.parseI
...read more
Java
Java-Strings
Java-String-Programs
Java | ==, equals(), compareTo(), equalsIgnoreCase() and compare()
Last Updated: 06 March 2023
There are many ways to compare two Strings in Java:Using == operatorUsing equals() methodUsing compareTo() methodUsing compareToIgnoreCase()
...read more
Java
Technical Scripter
Java-Strings
Picked
Technical Scripter 2018
Java-String-Programs
Convert a List of String to a comma separated String in Java
Last Updated: 21 October 2022
Given a List of String, the task is to convert the List to a comma separated String in Java.Examples:Input: ListString = ["Geeks", "ForGeeks
...read more
Java
Java-Strings
Java Programs
Java-String-Programs
Java-List-Programs
Convert List of Characters to String in Java
Last Updated: 31 July 2023
Given a list of characters. In this article, we will write a Java program to convert the given list to a string.Example of List-to-String Co
...read more
Java
Technical Scripter
Java-Strings
java-list
Picked
Java-StringJoiner
Technical Scripter 2018
Java-String-Programs
Java-List-Programs
Check if a String Contains only Alphabets in Java using Regex
Last Updated: 05 April 2022
Regular Expressions or Regex is an API for defining String patterns that can be used for searching, manipulating, and editing a text. It is
...read more
Java
Java-Strings
java-regular-expression
Java-String-Programs
Java String toLowerCase() Method
Last Updated: 23 December 2024
Java String toLowerCase() method is used to convert all letters to lowercase in a given string.Example:[GFGTABS] Java import j
...read more
Java
Java-Strings
Java-Functions
DSA
Java String equalsIgnoreCase() Method
Last Updated: 23 December 2024
In Java, equalsIgnoreCase() method of the String class compares two strings irrespective of the case (lower or upper) of the string. This me
...read more
Java
Java-Strings
Java-lang package
Java-Functions
Set to Array in Java
Last Updated: 29 March 2024
Given a set (HashSet or TreeSet) of strings in Java, convert it into an array of strings.Input : Set hash_Set = new HashSet(); hash_S
...read more
Misc
Java
Java-Collections
Java-Strings
Java-Arrays
java-treeset
java-hashset
java-set
Java-Array-Programs
Java-Set-Programs
String replace() method in Java with Examples
Last Updated: 16 February 2024
The String replace() method returns a new string after replacing all the old characters/CharSequence with a given character/CharSequence.Exa
...read more
Strings
Java
Java-Strings
Java-lang package
Java-Functions
DSA
Swapping Characters of a String in Java
Last Updated: 16 October 2024
As we know that Object of String in Java are immutable (i.e. we cannot perform any changes once its created).To do modifications on string s
...read more
Strings
Java
Java-Strings
Java-String-Programs
DSA
Java Program to Trim Leading and Trailing Spaces from a String
Last Updated: 27 November 2024
In Java, the trim() method is used to remove leading and trailing spaces from a string. This method does not remove spaces between words but
...read more
Java
Java-Strings
Java Programs
Java-String-Programs
First
1
2
3
4
5
6
7
8
>>
Last
First
1
2
3
4
5
6
>>
Last
First
2
3
4
5
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !