Write a StringBuilder endsWith() program

Write a StringBuilder endsWith() program

Program
import java.util.Scanner;
public class Main
{
    public static void main(String args[])
    {
        String s1;
        Scanner sc=new Scanner(System.in);
        System.out.println("Enter String : ");
        s1=sc.nextLine();
        StringBuilder sb1=new StringBuilder(s1);
        System.out.println(sb1.toString().endsWith("Welcome"));
    }
}


Output:

Enter String : Welcome to Java Class
false


Strings Handling In Java



More Questions


202 . Write a StringBuilder endsWith() program
203 . Write a StringBuilder indexOf() program
204 . Write a StringBuilder lastIndexOf() program
205 . Write a StringBuilder substring() program
206 . Write a StringBuilder trim() program
207 . Write a StringBuilder insert() program
208 . Write a StringBuilder delete() program
209 . Write a StringBuilder append() program
210 . Write a StringBuilder replace() Program
211 . Write a Java-program to Count the number of vowels in a given string ?
212 . Write a Java-program to Count the number of Consonants in a given string ?