replace() StringBuffer Example

replace() StringBuffer Method java.lang.StringBuffer class comes with many methods to manipulate string. replace() method replaces a group of characters in the buffer. What Java API says about replace() StringBuffer: public synchronized java.lang.StringBuffer replace(int startIndex, int endIndex, String string1): Replaces a group of characters of string buffer from startIndex to endIndex-1 with string string1. Replaced number …

replace() StringBuffer Example Read More »