Answered by AI, Verified by Human Experts
Programthat will request a String from the user console.log(string.split(""). string.split(b).length - string.split(a).length sort((a,b))How are words in a string array counted?Pass the byte array to the constructor of the String class to create an instance of it. Read the words from the String into an array using the split() technique. Create an integervariableand set its initial value to 0. Then, for each entry of the string array in the for loop, increase the count.How do you determine how many words are in a string?Establish a string. We will loop through thestringand count the number of spaces to determine how many words are present because a gap always follows each word. if a space is used to begin a string.To know more aboutStringvisit:-brainly.com/question/14528583#SPJ4...