CSC104H1 Lecture Notes - Lecture 3: Substring

33 views4 pages

Document Summary

; get-excited : (define (get-excited s) string string (cond [(equal? (substring s (- (string-length s) 2) (string-length s))) s] ; show the final result for each of the following. (get-excited cat) (get-excited cat!) (get-excited cat!!!) [else (append (f (rest l)) (list (first l)))])) ; show the steps to evaluate each of the following expressions. (step (f (list))) (step (hide (f (list))) (f (list 1))) (step (hide (f (list 1))) (f (list 2 1))) 2 (string-length s))) (substring s (- (string-lengths) 2) > s (x-2) x x substring. * x string x (x-1) index. * 5 string index 4 . 10 (substring s (- (string-lengths) 2) 8 9 2 substring 8 10 8 10 10 8 9 (string-length s))) Question 2 (f (list): (cond [(empty? (list)) (list)] [else (append (f (rest (list))) (list (first (list))))]: (cond [#true (list)] [else (append (f (rest (list))) (list (first (list))))]: (list) (f (list 1), (cond [(empty? (list 1)) (list)]

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions