String comparison: Difference between revisions
→{{header|jq}}: updates
(FutureBasic solution added) |
(→{{header|jq}}: updates) |
||
Line 2,504:
=={{header|jq}}==
jq strings are JSON strings. The jq comparison operators (==, !=, <, <=, >=, >) can be used to compare strings or indeed any JSON entities. Similarly, jq's <tt>sort</tt> and <tt>unique</tt> filters can be used to sort strings. The ordering of strings is determined by the Unicode codepoints.
<syntaxhighlight lang="jq"># Comparing two strings for exact equality:
Line 2,517:
# > is the inverse of < </syntaxhighlight>
jq provides `ascii_downcase` and `ascii_upcase` for ASCII case conversion.
With the caveat that these are what they are, case-insensitive comparisons can be achieved as illustrated by this example:
<syntaxhighlight lang="jq">("AtoZ" |
jq has an extensive library of built-in functions for handling strings. The most recent versions of jq (since 1.4) also have extensive support for PCRE regular expressions (regex), including named captures
Please see [http://stedolan.github.io/jq/manual/#Builtinoperatorsandfunctions|jq Builtin Operators and Functions] for details.
=={{header|Julia}}==
|