Write a string endsWith() program

Write a string endsWith() program

Program
import java.util.Scanner;
public class Main
{
    public static void main(String args[])
    {
        String s;
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter String : ");
        s=sc.nextLine();
        System.out.print(s.startsWith("Welcome"));
    }
}


Output:

Enter String 1 : Welcome To Java Class
false


Strings Handling In Java



More Questions


183 . Write a string endsWith() program
184 . Write a string indexOf() program
185 . Write a string lastIndexOf() program
186 . Write a String substring() program
187 . Write a string trim() program
188 . Write a StringBuffer insert() program
189 . Write a StringBuffer delete() program
190 . Write a StringBuffer append() program
191 . Write a StringBuffer replace() Program
192 . Write a StringBuilder length program
193 . Write a StringBuilder charAt() method program