We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 149c9f4 + 0e44268 commit 7b2da8eCopy full SHA for 7b2da8e
string_to_hump.md
@@ -29,6 +29,28 @@
29
30
##欢迎补充其它语言的解决方法
31
32
+###racket解决方法 (racket 5.2.1)
33
+
34
+```racket
35
+#lang racket
36
37
+; 定义字符串转换函数 train-to-camel
38
+(define (train-to-camel train-str separator-char)
39
+ (let
40
+ [(splited-str (regexp-split separator-char train-str))] ; 把原始字符串用 '-' 分成多个单独的单词
41
+ (string-append
42
+ (first splited-str)
43
+ (apply
44
+ string-append
45
+ (map
46
+ string-titlecase
47
+ (rest splited-str))))))
48
49
+; 调用字符串转换函数 train-to-camel
50
+(train-to-camel "this-is-a-var" "-") ; 正常运行的情况下, 应输出 "thisIsAVar"
51
52
+```
53
54
--------------
55
56
###联系我:老齐 qiwsir#gmail.com (# to @)
0 commit comments