From dfe6a533dafd2b5afccded4405ad8f78ba86f7c6 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Wed, 20 Mar 2024 10:06:43 +0000
Subject: Update website
---
manual/index.html | 239 ++++++++++++++++++++++++++++++++----------------------
1 file changed, 143 insertions(+), 96 deletions(-)
diff --git a/manual/index.html b/manual/index.html
index a3ff09fe..3674265a 100644
--- a/manual/index.html
+++ b/manual/index.html
@@ -4432,6 +4432,52 @@ ends with it.
+
+
+ trim
, ltrim
, rtrim
+
+
+ trim
trims both leading and trailing whitespace.
+ltrim
trims only leading (left side) whitespace.
+rtrim
trims only trailing (right side) whitespace.
+Whitespace characters are the usual " "
, "\n"
"\t"
, "\r"
+and also all characters in the Unicode character database with the
+whitespace property. Note that what considers whitespace might
+change in the future.
+
+
+ Example
+
+
+
+
+ Command
+ jq 'trim, ltrim, rtrim'
+
+
+ Input
+ " abc "
+
+
+ Output
+ "abc"
+
+
+
+ "abc "
+
+
+
+ " abc"
+
+
+ Run
+
+
+
+
+
+
explode
@@ -4440,10 +4486,10 @@ ends with it.
Converts an input string into an array of the string's
codepoint numbers.
-
+
Example
-
+
Command
@@ -4472,10 +4518,10 @@ codepoint numbers.
The inverse of explode.
-
+
Example
-
+
Command
@@ -4506,10 +4552,10 @@ codepoint numbers.
split
can also split on regex matches when called with
two arguments (see the regular expressions section below).
-
+
Example
-
+
Command
@@ -4544,10 +4590,10 @@ returns said input string.
Null values are treated as empty strings. Arrays and objects
in the input are not supported.
-
+
Examples
-
+
Command
@@ -4595,10 +4641,10 @@ in the input are not supported.
Emit a copy of the input string with its alphabetic characters (a-z and A-Z)
converted to the specified case.
-
+
Example
-
+
Command
@@ -4632,10 +4678,10 @@ recursive jq function. Recursive calls within while
will
not consume additional memory if update
produces at most one
output for each input. See advanced topics below.
-
+
Example
-
+
Command
@@ -4669,10 +4715,10 @@ recursive jq function. Recursive calls within repeat
will
not consume additional memory if exp
produces at most one
output for each input. See advanced topics below.
-
+
Example
-
+
Command
@@ -4708,10 +4754,10 @@ recursive jq function. Recursive calls within until()
will
not consume additional memory if next
produces at most one
output for each input. See advanced topics below.
-
+
Example
-
+
Command
@@ -4768,10 +4814,10 @@ could write recurse(.+1; true)
.
memory whenever f
produces at most a single output for each
input.
-
+
Examples
-
+
Command
@@ -4878,10 +4924,10 @@ array of arrays before processing the array itself. The second
example shows how all the keys of all the objects within the
input can be considered for alteration.
-
+
Examples
-
+
Command
@@ -4946,10 +4992,10 @@ set when the jq program started.
At the moment there is no builtin for setting environment
variables.
-
+
Examples
-
+
Command
@@ -4997,10 +5043,10 @@ variables.
Transpose a possibly jagged matrix (an array of arrays).
Rows are padded with nulls so the result is always rectangular.
-
+
Example
-
+
Command
@@ -5036,10 +5082,10 @@ after the insertion of x at ix. If the array is not sorted,
bsearch(x)
will return an integer that is probably of no
interest.
-
+
Examples
-
+
Command
@@ -5106,10 +5152,10 @@ interest.
after a backslash. Whatever the expression returns will be
interpolated into the string.
-
+
Example
-
+
Command
@@ -5141,10 +5187,10 @@ or parse JSON texts into values, respectively. The tojson
builtin differs from tostring
in that tostring
returns strings
unmodified, while tojson
encodes strings as JSON strings.
-
+
Examples
-
+
Command
@@ -5275,10 +5321,10 @@ literal will be escaped. For instance,
Note that the slashes, question mark, etc. in the URL are
not escaped, as they were part of the string literal.
-
+
Examples
-
+
Command
@@ -5406,10 +5452,10 @@ in typical C library documentation. The format string for ISO
some systems. In particular, the %u
and %j
specifiers for
strptime(fmt)
are not supported on macOS.
-
+
Examples
-
+
Command
@@ -5536,10 +5582,10 @@ is irrelevant. If you're coming from JavaScript, please note that jq's ==
JavaScript's ===
, the "strict equality" operator.
!= is "not equal", and 'a != b' returns the opposite value of 'a == b'
-
+
Examples
-
+
Command
@@ -5631,10 +5677,10 @@ once for each result that is not false or null, and C
is evaluated
once for each false or null.
More cases can be added to an if using elif A then B
syntax.
-
+
Example
-
+
Command
@@ -5673,10 +5719,10 @@ to, less than or equal to or less than their right argument
(respectively).
The ordering is the same as that described for sort
, above.
-
+
Example
-
+
Command
@@ -5720,10 +5766,10 @@ than the common Perl/Python/Ruby idiom of
form of "or", picking between two values rather than
evaluating a condition, see the //
operator below.
-
+
Examples
-
+
Command
@@ -5848,10 +5894,10 @@ generator of three values, and since it produces a
value other false
and null
, the default 42
is not
produced.
-
+
Examples
-
+
Command
@@ -5965,10 +6011,10 @@ if any, is output as if it had been the output of the
expression to try.
The try EXP
form uses empty
as the exception handler.
-
+
Examples
-
+
Command
@@ -6062,10 +6108,10 @@ is lexical: the label has to be "visible" from the break.
The ?
operator, used as EXP?
, is shorthand for try EXP
.
-
+
Examples
-
+
Command
@@ -6156,10 +6202,10 @@ to form a regular expression must be escaped. For example, the regular expressio
Like match
, but does not return match objects, only true
or false
for whether or not the regex matches the input.
-
+
Examples
-
+
Command
@@ -6225,10 +6271,10 @@ the following fields:
Capturing groups that did not match anything return an offset of -1
-
+
Examples
-
+
Command
@@ -6343,10 +6389,10 @@ the following fields:
of each capture as the key, and the matched string as the
corresponding value.
-
+
Example
-
+
Command
@@ -6379,10 +6425,10 @@ have been specified. If there is no match, the stream is empty.
To capture all the matches for each input string, use the idiom
[ expr ]
, e.g. [ scan(regex) ]
.
-
+
Example
-
+
Command
@@ -6417,10 +6463,10 @@ To capture all the matches for each input string, use the idiom
For backwards compatibility, when called with a single argument,
split
splits on a string, not a regex.
-
+
Example
-
+
Command
@@ -6450,10 +6496,10 @@ To capture all the matches for each input string, use the idiom
These provide the same results as their split
counterparts,
but as a stream instead of an array.
-
+
Example
-
+
Command
@@ -6501,10 +6547,10 @@ as a JSON object (as constructed by capture
) to
tostring
, so a reference to a captured variable named "x"
would take the form: "\(.x)"
.
-
+
Examples
-
+
Command
@@ -6553,10 +6599,10 @@ would take the form: "\(.x)"
.
replaced by tostring
, after interpolation. If the second argument is a stream
of jq strings, then gsub
will produce a corresponding stream of JSON strings.
-
+
Examples
-
+
Command
@@ -6693,10 +6739,10 @@ particular there's no way to change the value of a binding;
one can only setup a new binding with the same name, but which
will not be visible where the old one was.
-
+
Examples
-
+
Command
@@ -6812,10 +6858,10 @@ that occur during the final alternative are passed through.
[[3]] | .[] as [$a] ?// [$b] | if $a != null then error("err: \($a)") else {$a,$b} end
-
+
Examples
-
+
Command
@@ -6926,10 +6972,10 @@ number of function arguments, but only for references from
functions (or main program) subsequent to the re-definition.
See also the section below on scoping.
-
+
Examples
-
+
Command
@@ -6994,10 +7040,10 @@ $times_three | [. + $times_three]) | ...: here the binding
Returns true if exp
produces no outputs, false otherwise.
-
+
Examples
-
+
Command
@@ -7062,10 +7108,10 @@ $times_three | [. + $times_three]) | ...: here the binding
The limit
function extracts up to n
outputs from exp
.
-
+
Example
-
+
Command
@@ -7097,10 +7143,10 @@ and last values from expr
, respectively.
The nth(n; expr)
function extracts the nth value output by expr
.
Note that nth(n; expr)
doesn't support negative values of n
.
-
+
Example
-
+
Command
@@ -7131,10 +7177,10 @@ Note that nth(n; expr)
doesn't support negative values of n
and last values from any array at .
.
The nth(n)
function extracts the nth value of any array at .
.
-
+
Example
-
+
Command
@@ -7176,10 +7222,10 @@ so the effect is similar to running something like this:
3 as $item | . + $item
-
+
Examples
-
+
Command
@@ -7262,10 +7308,10 @@ to running something like this:
When EXTRACT
is omitted, the identity filter is used.
That is, it outputs the intermediate values as they are.
-
+
Examples
-
+
Command
@@ -7417,10 +7463,10 @@ recursive call by _range
to itself is in tail position.
The example shows off three advanced topics: tail recursion,
generator construction, and sub-functions.