Skip to content

Tag Archives: java-StringBuffer

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
Given numeric string str, the task is to remove all the leading zeros from a given string. If the string containing only zeros, then print… 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
Given a String, the task is to insert another string in between the given String at a particular specified index in Java. Examples: Input: originalString… Read More
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
In StringBuffer class, there are two types of lastIndexOf() method depending upon the parameters passed to it. lastIndexOf(String str) The lastIndexOf(String str) method of StringBuffer… Read More
In StringBuffer class, there are two types of substring method depending upon the parameters passed to it. substring(int start) The substring(int start) method of StringBuffer… Read More
The toString() method of StringBuffer class is the inbuilt method used to returns a string representing the data contained by StringBuffer Object. A new String… Read More
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 actual sequence… Read More
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… Read More
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… Read More
The codePointAt() method of StringBuffer class returns a character Unicode point at that index in sequence contained by StringBuffer. This method returns the “Unicodenumber” of… Read More
The ensureCapacity() method of StringBuffer class ensures the capacity to at least equal to the specified minimumCapacity. If the current capacity of StringBuffer < the… Read More
The trimToSize() method of StringBuffer class is the inbuilt method used to trims the capacity used for the character sequence of StringBuffer object. If the… Read More