Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java check if string ends with

public class EndsWithExample{
   public static void main(String args[]){
       String str1 = new String("This is a test String");
       String str2 = new String("Test ABC");
       boolean var1 = str1.endsWith("String");
       boolean var2 = str1.endsWith("ABC");
       boolean var3 = str2.endsWith("String");
       boolean var4 = str2.endsWith("ABC");
       System.out.println("str1 ends with String: "+ var1);
       System.out.println("str1 ends with ABC: "+ var2);
       System.out.println("str2 ends with String: "+ var3);
       System.out.println("str2 ends with ABC: "+ var4);
   }
}
Comment

PREVIOUS NEXT
Code Example
Java :: interface extending interface in java 
Java :: java checked exception 
Java :: Infinite While Loop Java Example 
Java :: better way to check string on null and empty java 
Java :: R8: java.lang.OutOfMemoryError: GC overhead limit exceeded react-native 
Java :: Fix arabic javafx 
Java :: Java How to use Queue? 
Java :: java Convert a string IPv4 IP address to the equivalent long numeric value. 
Java :: java opp 
Java :: how to get orientation lock to portrait android stackoverflow 
Java :: framboise bleue ou mure 
Java :: how to create a java library in intellij 
Java :: how to call super onbackpressed in fragment 
Java :: java stream inner join two lists 
Java :: leer XML java 
Java :: java code for scientific calculator GUI 
Java :: student information using array of object java 
Java :: how to remove scroll pane border 
Java :: Iterating Through the Java Map 
Java :: module java.base does not "opens java.io" to unnamed module 
Java :: android select video samsung stackoverflow 
Java :: JFrame change outline 
Java :: what is arraylist 
Java :: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 
Java :: get width and height of screen libgdx 
Java :: t implements comparable 
Java :: update java windows 
Java :: java stream add to existing list 
Java :: determine if a number is factorial in Java 
Java :: how to create textview in java android 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =