Java Program to Clear the StringBuffer - Programiz
In this example, we will learn to clear the string buffer using the delete() and setLength() method and creating a new StringBuffer object in Java.
In this example, we will learn to clear the string buffer using the delete() and setLength() method and creating a new StringBuffer object in Java.
The best way to learn Java programming is by practicing examples. The page contains examples on basic concepts of Java. You are advised to take the references from these examples and try them on your own.
In Java, we have two strings named str1 and str2. We are checking if str1 and str2 are anagrams. We first convert the strings to lowercase.Hence, strings should be converted to the same case. Example 2: Take string inputs from users and check if the strings are anagram.
Open your browser and start coding with Programiz's free online compilers and text editors. Learn to code including Python, JavaScript, SQL, C, C++ and more...Learn programming step by step. Each lesson contains plenty of practical code that you can run directly in your browser.