Java StringBuilder replace() method

replace(int startIndex, int endIndex, String str): replace the substring of the string builder from startIndex to endIndex-1 with the specified string.   Syntax: public StringBuilder replace(int startIndex, int endIndex, String str)   Note: startIndex should be between 0 and to length of the string or less than endIndex, if it is not StringIndexOutOfBoundsException will be … Read more