diff options
author | pkoppstein <pkoppstein@gmail.com> | 2014-10-06 22:51:13 -0400 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2014-12-27 18:38:52 -0600 |
commit | 56344670f4aea8bedb5bbbab55c28918fa9224a8 (patch) | |
tree | 92295991c1debacbfe5d0ea385e701e73cc8e527 /builtin.c | |
parent | 5df20f4954a5d3c2b2b1086bf758c1c9e7f3a61d (diff) |
ascii_upcase/0 and ascii_downcase/0
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1155,6 +1155,12 @@ static const char* const jq_builtins[] = { " exp, _repeat;" " try _repeat catch if .==\"break\" then empty else . end;", "def inputs: repeat(_input);", + // # 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;", }; #undef LIBM_DD |