?
Solved

Remove element from an array in vbscript.

Posted on 2014-04-29
4
Medium Priority
?
389 Views
Last Modified: 2014-04-29
I have an array named 'MemberGroup' which has a number of elements e.g.

Members = ("APPLES 145","BANANAS 234","CELERY 897","DOG 787","ENGINE 546","FLURIDE 878")

I am looking for the best way in vbscript that I can remove an element from this array that contains e.g. 234 - which would remove the BANANAS 234 element? It is important that the array reflects the correct new size and that the element order is not changed in any way.

I am sure this is very simple - any ideas?
0
Comment
Question by:Blowfelt82
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Expert Comment

by:Manuel Marienne-Duchêne
ID: 40029123
0
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 40029124
Hi,

You could use Filter

Members = Array("APPLES 145", "BANANAS 234", "CELERY 897", "DOG 787", "ENGINE 546", "FLURIDE 878")
NewMembers = Filter(Members, " 234", False)

Open in new window

Regards
0
 
LVL 52

Expert Comment

by:Rgonzo1971
ID: 40029133
@ manumd

Blind links are not acceptable answers
See
http://support.experts-exchange.com/customer/portal/articles/1162518

Regards
0
 

Author Closing Comment

by:Blowfelt82
ID: 40029155
Perfect answer - thanks,
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question