Skip to content

Tag Archives: Java-StringBuilder

What are Ropes? Rope is a binary tree data structure where each node except the leaf contains the number of characters present to the left… Read More
Given two strings A and B of length N, the task is to check if any of the two strings formed by splitting both the… Read More
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
In the given example only one object will be created. Firstly JVM will not find any string object with the value “Welcome” in string constant… Read More
StringBuilder in Java represents a mutable sequence of characters. Since the String Class in Java creates an immutable sequence of characters, the StringBuilder class provides… Read More
 In Java, here we are given a string, the task is to replace a character at a specific index in this string. Examples:  Input: String… 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 argument… 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 the StringBuilder class is the inbuilt method used to return a string representing the data contained by StringBuilder Object. A new… 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

Start Your Coding Journey Now!