Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Purpose: Given a string and a placeholding index, produce the string at where the character at index is removed.
- ; Signature: String & Number -> String
- ; Examples:
- (check-expect (string-delete "abc" 1) "ac")
- (check-expect (string-delete "str" 2) "st")
- ; Stub:
- ;(define (string-delete str index) -1)
- ; Template:
- ; (define (delete-string str index)
- ; (substring ... ... ...)
- ; )
- ; Code:
- (define (string-delete str index)
- (string-append (substring str 0 index)(substring str (+ index 1) (string-length str)))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement