|
Subject: Re: need a little scheme help From: Dave Love <d.love@xxxxxxxx> Date: 12 Oct 1998 20:27:46 +0100 |
>>>>> "Bas" == Bas Peters <bpeters@xxxxxx> writes:
Bas> It removes the last character if the last character is a semi colon. I
Bas> would like to add a few OR statements, like this:
Bas> if ... ";" OR ":" OR "."
I'd write a function something like this and call it in the
appropriate place(s). [I wouldn't use such *names* for functions.]
(define (strip-trailing-punctuation s)
(let ((ls-1 (- (string-length s) 1)))
(case (string-ref s ls-1)
((#\; #\. #\,) (substring s 0 ls-1))
(else s))))
Bas> May be I should order a usefull Scheme book.
Harvey and Wright, `Simply Scheme' presents something like the
DSSSL-relevant subset of Scheme in a leisurely way, if that's what you
want.
DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| need a little scheme help, Bas Peters | Thread | jade 1.x MIF output, Glenn R. Kronschnabl |
| need a little scheme help, Bas Peters | Date | jade 1.x MIF output, Glenn R. Kronschnabl |
| Month |