string contains java

Java
// Java code to demonstrate case 
// sensitivity of contains() method 
class Gfg1 { 
  
    // Driver code 
    public static void main(String args[]) 
    { 
        String s1 = "Welcome! to GFG"; 
  
        // prints false 
        System.out.println(s1.contains("Gfg")); 
  
        // prints true 
        System.out.println(s1.contains("GFG")); 
    } 
} String s1 = "My name is GFG"; 
  
// prints true 
System.out.println(s1.contains("GFG")); 
  
// prints false 
System.out.println(s1.contains("geeks")); 
    
Source

Also in Java: