import java.util.*;
public class Main
{
public static void main (String[]args)
{
Scanner sc = new Scanner (System.in);
String mainStr = sc.nextLine ();
String searchStr = sc.nextLine ();
if (mainStr.contains (searchStr))
System.out.println (“TRUE”);
else
System.out.println (“FALSE”);
search_string=input(“Enter the search_string:\n”)
pattern_string=input(“Enter the pattern_string:\n”)
if pattern_string in search_string:
print(“True”)
else:
print(“False”)
String check(String search, String pattern) {
boolean flag = false;
String result = “”;
char char_search[] = search.toCharArray();
char char_pattern[] = pattern.toCharArray();
for (int i=0; i<char_pattern.length; i++) {
char c = char_pattern[i];
for (int j=0; j<char_search.length; j++) {
if(c == char_search[j]) {
flag = true;
break;
} else
flag = false;
}
if(flag == false)
break;
}
result = (flag)? "TRUE" : "FALSE";
return result;
}
Pyhton
s=input()
p=input()
if s in p:
print(“True”)
else:
print(“False”)
#include
#include
int sub_str(char [],char []);
int main()
{
int result;
char search[100];
char patern[100];
scanf(“%s”,search);
scanf(“%s”,patern);
result=sub_str(search,patern);
if(result==-1)
printf(“Substring not Found”);
else
printf(“Substring found”);
}
int sub_str(char search[],char patern[])
{
int i,j,k,l;
l=strlen(patern);
for(i=0;search[i+l-1];i++)
{
k=i;
for(j=0;j<=l-1;j++)
{
if(search[k]!=patern[j])
break;
k++;
}
if(j==l)
return(i);
}
return -1;
}
str1=’Hello how are you’
str2=’hello’
if str2.lower() in str1.lower():
print(‘True’)
else:
print(‘False’)
#python3
def sea(s1,s2):
return s1 in s2
a=str(input())
b=str(input())
print(sea(a,b))
import java.util.*;
public class Main
{
public static void main (String[]args)
{
Scanner sc = new Scanner (System.in);
String mainStr = sc.nextLine ();
String searchStr = sc.nextLine ();
if (mainStr.contains (searchStr))
System.out.println (“TRUE”);
else
System.out.println (“FALSE”);
}
}
search_string=input(“Enter the search_string:\n”)
pattern_string=input(“Enter the pattern_string:\n”)
if pattern_string in search_string:
print(“True”)
else:
print(“False”)