Exclude function
Warning
This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.
Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.
Namespace: Microsoft.Quantum.Arrays
Package: Microsoft.Quantum.Standard
Returns an array containing the elements of another array, excluding elements at a given list of indices.
function Exclude<'T> (remove : Int[], array : 'T[]) : 'T[]
Input
remove : Int[]
An array of indices denoting which elements should be excluded from the output.
array : 'T[]
Array of which the values in the output array are taken.
Output : 'T[]
An array output
such that output[0]
is the first element
of array
whose index does not appear in remove
,
such that output[1]
is the second such element, and so
forth.
Type Parameters
'T
The type of the array elements.
Example
let array = [10, 11, 12, 13, 14, 15];
// The following line returns [10, 12, 15].
let subarray = Exclude([1, 3, 4], array);
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for