September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
7
Task/String-case/Jq/string-case-1.jq
Normal file
7
Task/String-case/Jq/string-case-1.jq
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# like ruby's downcase - only characters A to Z are affected
|
||||
def ascii_downcase:
|
||||
explode | map( if 65 <= . and . <= 90 then . + 32 else . end) | implode;
|
||||
|
||||
# like ruby's upcase - only characters a to z are affected
|
||||
def ascii_upcase:
|
||||
explode | map( if 97 <= . and . <= 122 then . - 32 else . end) | implode;
|
||||
5
Task/String-case/Jq/string-case-2.jq
Normal file
5
Task/String-case/Jq/string-case-2.jq
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
"alphaBETA" | ascii_upcase
|
||||
#=> "ALPHABETA"
|
||||
|
||||
"alphaBETA" | ascii_downcase
|
||||
#=> "alphabeta"
|
||||
Loading…
Add table
Add a link
Reference in a new issue