Remove element from an array in vbscript.

Posted on 2014-04-29
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?
Question by:Blowfelt82
  • 2

Expert Comment

by:Manuel Marienne-Duchêne
ID: 40029123
LVL 48

Accepted Solution

Rgonzo1971 earned 500 total points
ID: 40029124

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

LVL 48

Expert Comment

ID: 40029133
@ manumd

Blind links are not acceptable answers


Author Closing Comment

ID: 40029155
Perfect answer - thanks,

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This script will sweep a range of IP addresses (class c only, 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…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now