fn subtractFromArray myArray mySub =
(
tmpArray = #()
for i in myArray do append tmpArray i
for i in mySub do
(
itemNo = finditem tmpArray i
local newArray = #()
if itemNo != 0 do
(
for j in 1 to (itemNo-1) do append newArray tmpArray[j]
for j in (itemNo+1) to tmpArray.count do append newArray tmpArray[j]
tmpArray = newArray
)
)
tmpArray
)
从一个数组减去另一个数组中的元素
最新推荐文章于 2024-08-30 11:28:00 发布