Solved

Remove element from an array in vbscript.

Posted on 2014-04-29
4
385 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
  • 2
4 Comments
 
LVL 6

Expert Comment

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

Accepted Solution

by:
Rgonzo1971 earned 500 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 50

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.

837 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