String and StringBuilder class both are used to handle string. StringBuilder is an immutable class means that you can insert, append and replace without creating a new StringBuilder instance each time. String is immutable, each time you perform an operation on the string – you are actually creating a new instance of string to replace