Created
May 6, 2020 21:01
-
-
Save geektutor/8daf6276c7c93e7bd423257bc6c82719 to your computer and use it in GitHub Desktop.
Day 6 Submissions of #30DaysOfCode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
search('I hope you scorelesss today', 'today'); | |
} | |
search(String text, String word) { | |
var literalList = text.split(" "); | |
if (literalList.contains(word)) { | |
print("Matched!"); | |
} else { | |
print("Not Matched!"); | |
} | |
} | |
/* | |
Write a program to search some literals strings in a string. | |
Sample text: 'I hope you scoreless today.' | |
Searched words : 'hope', 'today', 'fifteen' | |
If the string can be found, return/print "Matched!" else return/print "Not Matched!" | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment