4
answers
2
watching
381
views
12 May 2021
Check Substring You are given two strings s1 and s2. Write a function isSubstring(char s1[], char s2[]) which takes two strings as input, and returns the start index if the second string is a substring of the first, else returns -1. (Case Insensitive) Note: Print the result in the main() function. 4.1
Example 4.1.1
Input:
Starfish
Star
Output: 0
4.1.2
Input:
Starfish
Fish
Output:
4
4.1.3
Input:
Exhibition
habit
Output:
-1
Check Substring You are given two strings s1 and s2. Write a function isSubstring(char s1[], char s2[]) which takes two strings as input, and returns the start index if the second string is a substring of the first, else returns -1. (Case Insensitive) Note: Print the result in the main() function. 4.1
Example 4.1.1
Input:
Starfish
Star
Output: 0
4.1.2
Input:
Starfish
Fish
Output:
4
4.1.3
Input:
Exhibition
habit
Output:
-1
Read by 4 people
tanimpala456Lv1
17 May 2021
Already have an account? Log in
Read by 4 people
16 May 2021
Already have an account? Log in
Read by 4 people
12 May 2021
Already have an account? Log in