Asked by Anonymous
Write a function called myReplace() that performs a task similar to the string.replace() method. This function should take three parameters: The first, called the content string, can be any string. The second, called the token, should be a string containing a single character which is to be replaced in the content string. The third, should denote the new character(s) that will be in the resulting string. The function should return a new string with the token letter(s) replaced by the new characters. Your function should ensure valid input is provided, and return the original string if not. Note: You may not use the built-in replace() method for this question.
Answers
There are no AI answers yet. The ability to request AI answers is coming soon!
There are no human answers yet. A form for humans to post answers is coming very soon!