admin@onlinelearningcenter.in (+91) 7 999 01 02 03

Is String a substring

Suraj Ghimire
42 Posts

Given 2 String. WAP to check if a string is a substring of other.

Note: You should not use any predefined function and must deal with this logical by converting the string to character array and process it.

 

str1= "Hello World"

str2="Hello"

Answer: True

 

str1="Hello World"

str2="hellow"

Answer:True. You must ignore case sensitivity and spaces.

 

str1="Hello"

str1="hello"

Answer:True 

Published By : Suraj Ghimire
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

Jquery Comments Plugin