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.

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Commandjq '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.

- -
+
@@ -4472,10 +4518,10 @@ codepoint numbers.

The inverse of explode.

- -
+
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).

- -
+
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.

- -
+
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.

- -
+
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.

- -
+
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.

- -
+
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.

- -
+
Command
@@ -4768,10 +4814,10 @@ could write recurse(.+1; true).

memory whenever f produces at most a single output for each input.

- -
+
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.

- -
+
Command
@@ -4946,10 +4992,10 @@ set when the jq program started.

At the moment there is no builtin for setting environment variables.

- -
+
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.

- -
+
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.

- -
+
Command
@@ -5106,10 +5152,10 @@ interest.

after a backslash. Whatever the expression returns will be interpolated into the string.

- -
+
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.

- -
+
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.

- -
+
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.

- -
+
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'

- -
+
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.

- -
+
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.

- -
+
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.

- -
+
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.

- -
+
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.

- -
+
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.

- -
+
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.

- -
+
Command
@@ -6225,10 +6271,10 @@ the following fields:

Capturing groups that did not match anything return an offset of -1

- -
+
Command
@@ -6343,10 +6389,10 @@ the following fields:

of each capture as the key, and the matched string as the corresponding value.

- -
+
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) ].

- -
+
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.

- -
+
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.

- -
+
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)".

- -
+
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.

- -
+
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.

- -
+
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
 
- -
+
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.

- -
+
Command
@@ -6994,10 +7040,10 @@ $times_three | [. + $times_three]) | ...: here the binding

Returns true if exp produces no outputs, false otherwise.

- -
+
Command
@@ -7062,10 +7108,10 @@ $times_three | [. + $times_three]) | ...: here the binding

The limit function extracts up to n outputs from exp.

- -
+
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.

- -
+
Command
@@ -7131,10 +7177,10 @@ Note that nth(n; expr) doesn't support negative values of n..

The nth(n) function extracts the nth value of any array at ..

- -
+
Command
@@ -7176,10 +7222,10 @@ so the effect is similar to running something like this:

3 as $item | . + $item
- -
+
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.

- -
+
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.

- -
+
Command
@@ -7621,10 +7667,10 @@ as ["error message"] when an input text fails to parse.

number of path elements from the left of the outputs of the given streaming expression.

- -
+
Command
@@ -7658,10 +7704,10 @@ given streaming expression.

Outputs values corresponding to the stream expression's outputs.

- -
+
Command
@@ -7690,10 +7736,10 @@ outputs.

The tostream builtin outputs the streamed form of its input.

- -
+
Command
@@ -7776,10 +7822,10 @@ the left-hand side path will be deleted, as with del(path).

one will be used (COMPATIBILITY NOTE: in jq 1.5 and earlier releases, it used to be that only the last one was used).

- -
+
Command
@@ -7810,10 +7856,10 @@ releases, it used to be that only the last one was used).

equivalent to a |= . op b. So, += 1 can be used to increment values, being the same as |= . + 1.

- -
+
Command
@@ -7863,10 +7909,10 @@ field of the input, and produce the output {"a": 20, "b": 20}. The latter will set the a field of the input to the a field's b field, producing {"a": 10, "b": 20}.

- -
+
Command
@@ -8284,6 +8330,7 @@ by a semi-colon, where the first number is one of these:

"combinations, combinations(n)": "combinations", "ltrimstr(str)": "ltrimstr", "rtrimstr(str)": "rtrimstr", + "trim, ltrim, rtrim": "trim-ltrim-rtrim", "explode": "explode", "implode": "implode", "split(str)": "split-1", -- cgit v1.2.3
Command