first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

VB Script and ASP Code: the Split() Function Always Returns an Array; Empty Arrays; IsArray()

There may be the temptation to use the IsArray() function against the Split() function in some sort of data type validation test. However, the Split() function will always return True for such a test even when its required argument is a zero-length string.

In such a case, Split() will return an "empty array," an array where UBound() returns -1. This suggest that we should test empty arrays with a form like:

Dim vArray: vArray = Split("one two")
If UBound(vArray) <> -1 Then True 'We have an array.
mod date: 2003-08-23T00:39:42.000Z