RealDocs

UKismetArrayLibrary::Array_RemoveItem

function Engine Blueprint Since unknown
#include "Kismet/KismetArrayLibrary.h"
Access: public Specifiers: staticBlueprintCallableCustomThunk

Description

Removes all instances of a value from an array and reports whether anything was removed.

Caveats & Gotchas

  • Removes every matching instance, not just the first — equivalent to TArray::Remove(), not RemoveSingle().
  • Displayed in Blueprint as 'Remove Item' with CompactNodeTitle 'REMOVE'; distinct from the index-based 'Remove Index' node backed by Array_Remove.
  • Equality is evaluated per-element using the array's element type comparison, so for struct or object arrays this depends on that type having a meaningful operator==.

Signature

static bool Array_RemoveItem(UPARAM(ref) TArray<int32>& TargetArray, const int32 &Item);

Parameters

Name Type Description Default
TargetArray UPARAM(ref) TArray<int32>& The array to remove from. Passed by reference and mutated in place.
Item const int32& The value to remove from the array.

Return Type

bool

Example

Remove all matching values C++
TArray<int32> Values = { 1, 2, 2, 3 };
const bool bRemoved = UKismetArrayLibrary::Array_RemoveItem(Values, 2);
// Values is now { 1, 3 }, bRemoved is true

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.