Challenge: Searching a String
Test yourself and implement what you have learned so far in this challenge.
We'll cover the following
Problem Statement
You are given a string and you have to find the first three-letter word in that string. The only condition is that the word must consist of all lower-case letters.
Input
The input is the variable stringToFindExpression
in which the string to be searched is stored.
stringToFindExpression
has already been declared for you.
Output
The output will be the value assigned to match1
.
Sample Input
"The car is red."
Sample Output
"car"
Test Yourself
Write your code in the given area. Try the exercise by yourself first, but if you get stuck, the solution has been provided. Good luck!
//Modify match1val match1 = Array(1)
Let’s go over the solution review in the next lesson.