1import java.util.Scanner;
2
3public class ProgrammingEx4_22 {
4
5 public static void main(String[] args) {
6 Scanner input = new Scanner(System.in);
7
8 System.out.print("Enter string s1:");
9 String s1 = input.nextLine();
10 System.out.print("Enter string s2:");
11 String s2 = input.nextLine();
12
13 if (s1.contains(s2)) {
14 System.out.println(s2 + " is a substring of " + s1);
15 } else {
16 System.out.println(s2 + " is not a substring of " + s1);
17 }
18
19 }
20
21}
22