Question: Modify the java scripts so the output indicates the number of words as well as the length of each word. Example output: The string 'Docker
Modify the java scripts so the output indicates the number of words as well as the length of each word. Example output: The string 'Docker has the image which it uses to create a container' has 11 tokens: 1 Docker - length of 6 2 has length of 3 3 the - length of 3 Note that the length of a string is returned by the function length (tokens[i].length) - the length of the string at position i) while the size of an array is returned by the property length (tokens.length) the script and a screenshot of the result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
