Racket error in string-replace function?
<p>I am writing
a function string-replace which consumes a string, a target character, and a
replacement character. The function produces a new string, which is identical to the
consumed string with all occurrences of the target character (if any) replaced with the
replacement character. For example, <code>(string-replace "word" #\o #\y) ⇒ "wyrd"</code> </p>

<p>Note:
I cannnot use any built-in string functions other than <code>string-&gt;list</code> and <code>list-&gt;string</code></p>

<p>My code looks like</p>

<pre><code>  (define(list-replace input-list from-char to-char)
     (string-replace input-list from-char to-char))

 (define(string-replace input-string from-char to-char)
  (list-&gt;string(string-replace(string-&gt;list input-string) from-char to-char)))
</code></pre>

<p>To check I enter 
      <code>(string-replace "word" #\o #\y)</code> I am getting an error <code>string-&gt;list: expects a string, given (cons #\w (cons #\o (cons #\r (cons #\d empty))))</code></p>

<p>Can someone help me in this code to make it work?</p>