Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Java
10.8K+ articles
Java-Functions
4.2K+ articles
Strings
3.3K+ articles
Java-lang package
417+ articles
java-basics
330+ articles
Java-Strings
240+ articles
Java-String-Programs
148+ articles
Java-StringBuilder
35+ articles
java-StringBuffer
37 posts
Recent Articles
Popular Articles
StringBuffer offsetByCodePoints() method in Java with Examples
Last Updated: 04 December 2018
The offsetByCodePoints() method of StringBuffer class returns the index within this String contained by StringBuffer that is offset from the index passed as parameter by c...
read more
Java
java-basics
Java-lang package
Java-Functions
java-StringBuffer
StringBuffer getChars() method in Java with Examples
Last Updated: 17 November 2022
The getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) method of StringBuffer class copies the characters starting at the index:srcBegin to index:srcEnd-1 from a...
read more
Java
java-basics
Java-lang package
Java-Functions
java-StringBuffer
StringBuffer setCharAt() method in Java with Examples
Last Updated: 04 December 2018
The setCharAt() method of StringBuffer class sets the character at the position index to character which is the value passed as parameter to method. This method returns a ...
read more
Java
java-basics
Java-lang package
Java-Functions
java-StringBuffer
StringBuffer indexOf() method in Java with Examples
Last Updated: 18 April 2023
In StringBuffer class, there are two types of indexOf() method depending upon the parameters passed to it.indexOf(String str)The indexOf(String str) method of StringBuffer...
read more
Java
java-basics
Java-lang package
Java-Functions
java-StringBuffer
Java Strings
Last Updated: 06 May 2025
In Java, a String is the type of object that can store a sequence of characters enclosed by double quotes, and every character is stored in 16 bits, i.e., using UTF 16-bit...
read more
Strings
Java
Java-Strings
Java-StringBuilder
java-StringBuffer
StringBuffer vs StringBuilder in Java
Last Updated: 15 October 2024
Java provides three classes to represent the sequence of characters i.e. String, StringBuffer, and StringBuilder. A string is immutable in Java whereas, both StringBuffer ...
read more
Java
Difference Between
Java-StringBuilder
java-StringBuffer
Remove leading zeros from a Number given as a string
Last Updated: 05 October 2022
Given numeric string str, the task is to remove all the leading zeros from a given string. If the string contains only zeros, then print a single "0".Examples:Input: str =...
read more
Strings
Pattern Searching
Mathematical
DSA
java-StringBuffer
regular-expression
Remove first and last character of a string in Java
Last Updated: 24 February 2025
Given a string str, the task is to write the Java Program to remove the first and the last character of the string and print the modified string.Examples:Input: str = "Gee...
read more
Strings
Java Programs
DSA
Java-StringBuilder
java-StringBuffer
Java-String-Programs
strings
Difference Between Length and Capacity in Java
Last Updated: 18 May 2023
Length and capacity are two different things in Java. Length basically increases when characters are appended to the string whereas the capacity increases when the current...
read more
Java
Difference Between
Picked
Java-Strings
java-StringBuffer
Python Program for Remove leading zeros from a Number given as a string
Last Updated: 18 April 2025
Given numeric string str, the task is to remove all the leading zeros from a given string. If the string contains only zeros, then print a single "0".Examples:Input: str =...
read more
Strings
Pattern Searching
Python
Python Programs
DSA
java-StringBuffer
regular-expression
Java StringBuffer capacity() Method
Last Updated: 10 January 2025
In Java, the capacity() method is used in the StringBuilder and StringBuffer classes to retrieve the current capacity of the object. The capacity is the amount of space th...
read more
Java
Java-Strings
java-StringBuffer
Java StringBuffer length() Method
Last Updated: 09 December 2024
The length() method in the StringBuffer class is used to retrieve the number of characters currently in a StringBuffer object. It helps determine the current size of the c...
read more
Java
Java-Strings
java-StringBuffer
Java StringBuffer charAt() Method
Last Updated: 09 December 2024
The charAt() method in the StringBuffer class in Java is used to retrieve the character at a given index in a StringBuffer object. This method allows us to access individu...
read more
Java
Java-Strings
java-StringBuffer
Java StringBuffer deleteCharAt() Method
Last Updated: 10 January 2025
In Java, the deleteCharAt() method of the StringBuffer class is used to delete the character at a specified index in the string. Example 1: The below Java program demonstr...
read more
Java
java-StringBuffer
Java StringBuffer chars() Method
Last Updated: 09 December 2024
In Java, the chars() method of the StringBuffer class converts the characters in the StringBuffer to an IntStream. This method is useful for iterating over, processing, or...
read more
Java
Java-Strings
java-StringBuffer
1
2
3
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 !