Stringbuffer replace

toUpperCase(), toLowerCase() and replace() String

Here, we do some miscellaneous operations on strings like converting a string from lowercase to uppercase or vice versa, removing unwanted prefix and suffix whitespaces and replacing a few characters with replace() String. Supported methods from String class. String toLowerCase(): Returns a new string containing all lowercase characters. All the…