Skip to content

Tag Archives: Java-StringBuilder

Given string str, the task is to write a Java program to swap the first and the last character of the given string and print… Read More
Given string str, the task is to write Java Program to remove the first and the last character of the string and print the modified… Read More
Strings in Java are the objects that are backed internally by a char array. Since arrays are immutable(cannot grow), Strings are immutable as well. Whenever… Read More
Strings in Java are Objects that are backed internally by a char array. Since arrays are immutable(cannot grow), Strings are immutable as well. Whenever a… Read More
The StringBuilder in Java represents a mutable sequence of characters. Since the String Class in Java creates an immutable sequence of characters, the StringBuilder class… Read More
Given a String, the task is to replace a character at a specific index in this string in Java. Examples:  Input: String = "Geeks Gor… Read More
The appendCodePoint(int codePoint) method of StringBuilder class is the inbuilt method used to append the string representation of the codePoint argument to this sequence. The… Read More
In StringBuilder class, there are two types of substring method depending upon the parameters passed to it. substring(int start) The substring(int start) method of StringBuilder… Read More
The toString() method of StringBuilder class is the inbuilt method used to returns a string representing the data contained by StringBuilder Object. A new String… Read More
The trimToSize() method of StringBuilder class is the inbuilt method used to trims the capacity used for the character sequence of StringBuilder object. If the… Read More
In StringBuilder class, there are two types of indexOf() method depending upon the parameters passed to it. indexOf(String str) The indexOf(String str) method of StringBuilder… Read More
In StringBuilder class, there are two types of lastIndexOf() method depending upon the parameters passed to it. lastIndexOf(String str) The lastIndexOf(String str) method of StringBuilder… Read More
The setLength(int newLength) method of StringBuilder is used to set the length of the character sequence equal to newLength.For every index k greater then 0… Read More
The subSequence(int start, int end) method of StringBuilder class is the inbuilt method used to return a subsequence of characters lie between index start and… Read More