| NMathFunctionsIf(Int32, FuncInt32, Boolean, Int32, Int32) Method |
Creates a new array by applying a logical function to the elements of an
array. Elements in the original array that return true are set to the given true value
in the new array; elements that return false are set to the given false value.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public static int[] If(
int[] data,
Func<int, bool> function,
int ifTrue,
int ifFalse
)
Public Shared Function If (
data As Integer(),
function As Func(Of Integer, Boolean),
ifTrue As Integer,
ifFalse As Integer
) As Integer()
public:
static array<int>^ If(
array<int>^ data,
Func<int, bool>^ function,
int ifTrue,
int ifFalse
)
static member If :
data : int[] *
function : Func<int, bool> *
ifTrue : int *
ifFalse : int -> int[]
Parameters
- data Int32
- An array of integers.
- function FuncInt32, Boolean
- A function that takes an integer and returns a boolean.
- ifTrue Int32
- Value in case of true.
- ifFalse Int32
- Value in case of false.
Return Value
Int32A new array.
See Also