• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 395
  • Last Modified:

Remove element from an array in vbscript.

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
Blowfelt82
Asked:
Blowfelt82
  • 2
1 Solution
 
Manuel Marienne-DuchĂȘneITMCommented:
0
 
Rgonzo1971Commented:
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
 
Rgonzo1971Commented:
@ manumd

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

Regards
0
 
Blowfelt82Author Commented:
Perfect answer - thanks,
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now