# Vocabulary/semidot0

>>
<< ` `
Down to: Dyad ` `
Back to: Vocabulary
Thru to: Dictionary

`u;.0 y`Reversed Adverb

Rank Infinity *-- operates on x and y as a whole --*
WHY IS THIS IMPORTANT?

`u;.0 y` **reverses** `y` along all its axes, and then applies the verb `u` to the reversed `y`.

If `y` is a list, `u;.0 y` is the same as `u |. y` .

### Common uses

1. Apply `u` to the reversal of `y`:

isinstring =: +./@:E. NB. 1 if x is found in y 'ode'&isinstring 'boustrophedonic' 0 'ode'&isinstring;.0 'boustrophedonic' 1

### Related Primitives

Reverse (`|. y`)

`x u;.0 y`Subarray Adverb

Rank 2 _ *-- operates on tables of x and the entirety of y --*
WHY IS THIS IMPORTANT?

In `x u;.0 y`, `x` describes a subarray of `y`.
The subarray is extracted from `y`, and then verb `u` is applied to it.

In these examples `u` is `]`, which simply passes the selected subarray unchanged.

]a =. a. {~ (a. i. 'a') + i. 4 4 NB. A 4x4 array abcd efgh ijkl mnop (0 0 ,: 2 2) ];.0 a NB. starting at 0 0, take a subarray of shape 2 2 ab ef (1 2 ,: 3 2) ];.0 a NB. Starting at 1 2, take a subarray of shape 3 2 gh kl op

Argument `x` is a table with two rows. Each column of `x` gives the selection for the corresponding axis of `y`.
The first number in each column gives the starting position, and the second number gives the number of items selected.

Looking at it another way, the first row of `x` is the index list of the starting corner of the subarray,
and the second item gives the shape of the subarray.

### Common uses

1. Use ` x ];.0 y ` to extract a subarray. It is the fastest way to do it.

2. The **substr** function, which extracts a substring from a string, can be coded using ` x ];.0 y`

substr =: (];.0~ ,.)~"1 NB. x is (start,len), y is string to take from 2 4 substr 'boustrophedonic' ustr

3. If you want to apply a verb to the subarray, use that verb as `u`

(0 0 ,: 2 2) ,;.0 a NB. Select subarray, then enfile into a list abef

### Details

1. If the length causes the subarray to extend past the end of the array, the subarray is truncated at the end of the array.

(1 2 ,: 2 8) ];.0 a gh kl

2. A length of infinity (`_` or `__`) means "to the end of the array".

(2 ,: _) ];.0 'abcdefgh' cdefgh

3. If `x` is an atom or a list, it calls for a subarray whose shape is `,x`, starting at the beginning of the array.
In other words, `x` is treated as the second row of the left argument, and the first row is taken to be `0`.

2 3 ];.0 a abc efg

4. If `x` has fewer columns than the rank of `y`, trailing columns of `0 _` are added,
which take the omitted axes in their entirety

(2,:2) ];.0 a ijkl mnop

5. If a starting position is negative, it indicates a position relative to the *end* of that axis,
and is used as the *ending* position of the selection

**Note:** even though the selected region runs backwards from the start position, the selection retains its normal order

(2 _1 ,: 2 2) ];.0 a kl op

6. If a length is negative, that axis is reversed after the selection.

(2 _1 ,: 2 _2) ];.0 a NB. Axis 1 reversed lk po

7. The starting position must be a valid atom of the array,
**except** that the starting position of an axis may be just one higher than the end of the array **provided that** the corresponding length is 0.

8. The subarray of `y` always has the same rank as `y`.

9. If `x` has no columns, it selects all of `y`.

### Use These Combinations

Combinations using `x ;.0 y` that have exceptionally good performance include:

**What it does****Type;**

**Precisions;**

Ranks**Syntax****Variants;**

**Restrictions****Benefits;**

**Bug Warnings**Extract multiple substrings into a list Boolean list, byte list `x ;@:(<;.0) y`or `[: ; <;.0`avoids boxing, avoids creating subarrays Extract substring/subarray table or list `x ];.0 y`or `[;.0`avoids creating indexes