str) ((char=? #\nl (string-ref str (1- (string-length str)))) (substring str 0 (1- (string-length str)))) (else str)))