Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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;
|
||||
8
Task/String-case/Jq/string-case-2.jq
Normal file
8
Task/String-case/Jq/string-case-2.jq
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"alphaBETA" | ascii_upcase
|
||||
#=> "ALPHABETA"
|
||||
|
||||
"alphaBETA" | ascii_downcase
|
||||
#=> "alphabeta"
|
||||
|
||||
jq -n '"á" | test("Á";"i")' # case-insensitive search
|
||||
#=> true
|
||||
Loading…
Add table
Add a link
Reference in a new issue