Skip to content

Commit 782716a

Browse files
committed
string_to_hump.md 增加 ruby 方法
1 parent 7b2da8e commit 782716a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

string_to_hump.md

+12
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,16 @@
5353

5454
--------------
5555

56+
### Ruby 解决方法
57+
58+
```ruby
59+
str.split('-').map{|x| x.capitalize}.join
60+
```
61+
62+
```ruby
63+
str = 'border-bottom-color'
64+
str.split('-').map{|x| x.capitalize}.join
65+
# => "BorderBottomColor"
66+
```
67+
5668
###联系我:老齐 qiwsir#gmail.com (# to @)

0 commit comments

Comments
 (0)