<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Working with Array : Remove An Item</title>
</head>
<body>
<%
' First value must be FALSE
' Because we will try to search all items in array list
removedItem = False
Dim itemToRemove
itemToRemove = "Some words to remove"
arrayLength = UBound(myArray)
for i = 0 to arrayLength
if (myArray(i) = itemToRemove) then
' If we found our search term in array
' we are copying array to a new array list
myArray(i) = myArray(arrayLength)
' So now our first value must be TRUE
removedItem = True
end if
next
if (removedItem = True) then
' Let's make a new array and pass all values
redim preserve myArray(arrayLength - 1)
end if
%>
</body>
</html>
discuss this topic to forum
