programmingex4 22 java

Solutions on MaxInterview for programmingex4 22 java by the best coders in the world

showing results for - "programmingex4 22 java"
Emilie
22 Jun 2019
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
similar questions
queries leading to this page
programmingex4 22 java