Respuesta :
You should state what language you want your answer to be in before you ask programming questions. Here is what you're looking for in Java:
public static String replace(String str) {
return str.replace(' ', '*');
}
public static String replace(String str) {
return str.replace(' ', '*');
}
The function taken in an argument which is a string and gives an output of the same string with a asterisk (*) inserted inbetween each word. The program written in python 3 goes thus :
def replace(sentence):
#initialize a function named replace which takes in a single string sentence
sent = sentence.split()
#the sentence is split based on whitespace as a list of words which is attached to the variable called sent.
return '*'.join(sent)
Inbetween two words, a asterisk is appended using the join method.
print(replace('i am here'))
#A sample run of the function with an example is given and the output attached below.
Learn more : https://brainly.com/question/16403687