Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Contains

Returns true if a particular value is present in this container.
Read time 2 minutesLast updated 7 days ago

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule

Contains<T, U>(NativeArray<T>, T)

Returns true if a particular value is present in this container.
public static bool Contains<T, U>(this NativeArray<T> container, U value) where T : unmanaged, IEquatable<U>

Parameters

The container to search.

value

T
The value to locate.

Returns

Type

Description

boolTrue if the value is present in this container.

Contains<T, U>(ReadOnly, T)

Returns true if a particular value is present in this container.
public static bool Contains<T, U>(this NativeArray<T>.ReadOnly container, U value) where T : unmanaged, IEquatable<U>

Parameters

container

The container to search.

value

T
The value to locate.

Returns

Type

Description

boolTrue if the value is present in this container.

Contains<T, U>(NativeList<T>, T)

Returns true if a particular value is present in this container.
public static bool Contains<T, U>(this NativeList<T> container, U value) where T : unmanaged, IEquatable<U>

Parameters

container

The container to search.

value

T
The value to locate.

Returns

Type

Description

boolTrue if the value is present in this container.

Contains<T, U>(`<>*, int, T)

Returns true if a particular value is present in a buffer.
public static bool Contains<T, U>(T* ptr, int length, U value) where T : unmanaged, IEquatable<U>

Parameters

ptr

The buffer.

length

Number of elements in the buffer.

value

T
The value to locate.

Returns

Type

Description

boolTrue if the value is present in the buffer.

Contains<T, U>(ReadOnlySpan<T>, T)

Returns true if a particular value is present in this container.
public static bool Contains<T, U>(this ReadOnlySpan<T> roSpan, U value) where T : unmanaged, IEquatable<U>

Parameters

A ReadOnlySpan.

value

T
The value to locate.

Returns

Type

Description

boolTrue if the value is present in this container.