question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Ankur A3 commented

How to get part of Array after picking element?

Hi Team,

I have an array of size 8.

Array=[1,2,3,4,5,6,7,8]

PickedValue=6

How to get remaining part of array( [1,2,3,4,5,7,8] )after picking value 6?

Is there any function available to get it?

Thank you!


FlexSim 20.0.10
arraypartoperation
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Ankur A3 commented
Array myarray=[1,2,3,4,5,6,7,8];
int idx= myarray.indexOf(6);
myarray.splice(idx,1);
return myarray;
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·
1 Like 1 ·
Ankur A3 avatar image Ankur A3 commented ·
Thank you so much @Jason Lightfoot.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.