Knowsh.com

Algorithm to check if a string is a substring of the another string

http://www.knowsh.com

Algorithm to check if a string is a substring of the another string

Write an algorithm to accept two strings and check whether the second string exists within the first string. For example, if the first string is “concatenation” and the second string is “cat”, the algorithm should display “Substring found at position 4 in the string”. However, if the first string is “concatenation” and the second string is “tent”, the algorithm should display “Substring not found in the string”. It will check if the given string toCheck is a substring of str or not.

http://www.knowsh.com/NotesSearch/NotesDetail/100141/Check-if-a-string-is-a-substring-of-the-another-string

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s