Respuesta :
The right code is,
secondWord = sentence.substr (sentence.find ("`") + 1);
secondWord = secondWord.substr (0, secondWord.find ("`"));
Answer:
The solution code is written in Python.
- text = "broccoli is delicious."
- wordList = text.split(" ")
- secondword = wordList [1]
Explanation:
Firstly, let us declare a variable text and assign it with a string (Line 1).
Next, we can use the split() method and use single space character " " as the delimiter to separate the words in the string by turning it into a word list (e.g. ["broccoli", "is", "delicious."]) (Line 2)
We can use the index 1 to address the second word from the wordList and then associate it with variable secondword (Line 3).