Question: / / TODO: You should search the string oldString for the text found in commandWords starting from index 1 to the end of the
TODO: You should search the string "oldString" for the text found in
commandWords" starting from index to the end of the string array
First check if the length of commandWords is less than If it is then
print an error using printHelp and return null.
Get the text you need to search oldString for. Use combineWordsFrom
commandWords, to get the appropriate text.
Print out the index where the text is found in oldString or if not
found Use the String function indexOf for this.
Return null since searchText does not change the current string
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
