Finding words which are greater than given length k
We will take a string of words from the user along with an integer k. We will find all words whose length is greater than k.
Example:
Input:
"learn programming at includehelp", k = 6
Output:
programming, includehelp
Program to find words which are greater than given length
Output:
Explanation:
In the above code, we have taken a string myStr and integer k. Then we will create a collection of words from the string named words using the split method. Then find all words with a length greater than k in a collection called largerString. Then print the value of largerString.
need an explanation for this answer? contact us directly to get an explanation for this answer