Hello,

I have made this :

(define (string-insert s1 i)
  (if(> (string-length s1) 0)  (string-append (substring s1 0 i) "-" (substring s1 i (string-length s1)))))

But on the if I get a this message :

if: expected a question and two answers, but found only 2 parts

So I think that the if get sonehow messed up ,

What I try to do is this :

When the lenght of the string is greater then 0 then take the first part of the string  then put the - and the last part of the string. As last append the pieces to 1 piece.
Without the if everything works great on non empty strings.

Anyone a idea where I did make the wrong turn.

Roelof

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to