Given an "out" string length 4, such as "<<>>", and a word, return a new string where the word is in the middle of the out string, e.g. "<>". Note: use str.substring(i, j) to extract the String starting at index i and going up to but not including index j.
makeOutWord("<<>>", "Yay") → "<>"
makeOutWord("<<>>", "WooHoo") → "<>"
makeOutWord("[[]]", "word") → "[[word]]"

Respuesta :

Answer:

The following are the answer to this question.

Explanation:

In the given code, a "makeOutWord and word" is already used to hold some value. In this code, we define a string method "makeOutWord" that accepts two string variables "out and the word" in its parameter.

Inside the method, a return keyword is used that uses the string variable "out and the word" with the "substring" method, this method is used to returns a new string from an old string value, and it also uses the "word" string variable for the return value.  

please find the attached file for code:

Ver imagen codiepienagoya