mes: Add char-downcase, char-upcase.
* mes/module/srfi/srfi-14.mes (char-downcase, char-upcase): New function.
This commit is contained in:
parent
b7f5e1a8f9
commit
9543962ece
|
@ -76,3 +76,15 @@
|
|||
|
||||
(define (char-set-copy cs)
|
||||
(map identity cs))
|
||||
|
||||
(define (char-upcase c)
|
||||
(if (char-set-contains? char-set:lower-case c) (integer->char (- (char->integer c)
|
||||
(- (char->integer #\a)
|
||||
(char->integer #\A))))
|
||||
c))
|
||||
|
||||
(define (char-downcase c)
|
||||
(if (char-set-contains? char-set:upper-case c) (integer->char (+ (char->integer c)
|
||||
(- (char->integer #\a)
|
||||
(char->integer #\A))))
|
||||
c))
|
||||
|
|
Loading…
Reference in New Issue