对数组元素的MINUS操作

编程入门 行业动态 更新时间:2024-10-19 04:21:12
本文介绍了对数组元素的MINUS操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有一个数组说A =(11,23,32,44,56,88,55,14,78,79)和B =(44,56,88,55,14)。现在使用VBScript可以我执行Set操作 MINUS 以获得另一个输出,说C =(11,23,32,78,79)?

数组A和B也可以被认为是两个Excel列。

不想使用任何循环技术。

请帮助

谢谢,

解决方案

或许,这个字典是VBScript工具来实现(假的)集合和操作,这并不奇怪。请参阅此设置演示。

BTW:如果您必须处理多个事情,你必须循环或要求别人为你循环。坚持不循环,没有任何意义。如果它有效,您可以通过查找表或预先计算来替换多个循环(nxm .. xz)进行优化,但是如果不考虑循环,则不能理解问题。

I have an Array say A=(11,23,32,44,56,88,55,14,78,79) And B=(44,56,88,55,14) .Now using VBScript can I perform Set operation MINUS to get an other output say C=(11,23,32,78,79)?

Array A and B can be considered also two Excel columns.

Don't want to use any Looping technique.

Please help

Thanks,

解决方案

Perhaps it's not a surprise that Dictionaries are the VBScript tool to implement (fake?) sets and operations on them. See this Set demo.

BTW: If you have to deal with more than one thingy, you'll have to loop or ask someone else to loop for you. Insisting on "no loop, please" makes no sense. If 'it works', you may optimize by replacing multiple loops (n x m .. x z) by lookup tables or pre-computations, but you won't understand the problem, if you don't think of loopings.

更多推荐

对数组元素的MINUS操作

本文发布于:2023-07-29 00:42:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1235640.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数组   元素   操作

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!