aboutsummaryrefslogtreecommitdiff
path: root/dump/strings.scm
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-07-18 16:09:45 +0300
committerBonfaceKilz2023-07-30 12:29:56 +0300
commitd27851ca714d2b0c2256d295df38e1b841547aed (patch)
tree3a91aa3b8342f54903ddd0f8fb37e099efb337fb /dump/strings.scm
parent4c6ff9d1199ec9ba43a826dad3df2e766190d327 (diff)
downloadgn-transform-databases-d27851ca714d2b0c2256d295df38e1b841547aed.tar.gz
Add string-capitalize-first
* dump/strings.scm: Export string-capitalize-first (string-capitalize-first): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'dump/strings.scm')
-rw-r--r--dump/strings.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/dump/strings.scm b/dump/strings.scm
index 849b3c3..282b4e1 100644
--- a/dump/strings.scm
+++ b/dump/strings.scm
@@ -10,7 +10,8 @@
delete-substrings
replace-substrings
sanitize-rdf-string
- snake->lower-camel))
+ snake->lower-camel
+ string-capitalize-first))
(define (time-unix->string seconds . maybe-format)
"Given an integer saying the number of seconds since the Unix
@@ -92,3 +93,8 @@ association list mapping substrings to their replacements."
char))))
(drop char-list 1)
char-list)))))
+
+(define (string-capitalize-first string)
+ (string-titlecase
+ (string-downcase string) 0 1))
+