fix some file extensions
This commit is contained in:
parent
68f8f3e56b
commit
f3a896c724
789 changed files with 91 additions and 62 deletions
32
Task/Flatten-a-list/VBScript/flatten-a-list-1.vb
Normal file
32
Task/Flatten-a-list/VBScript/flatten-a-list-1.vb
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
class flattener
|
||||
dim separator
|
||||
|
||||
sub class_initialize
|
||||
separator = ","
|
||||
end sub
|
||||
|
||||
private function makeflat( a )
|
||||
dim i
|
||||
dim res
|
||||
for i = lbound( a ) to ubound( a )
|
||||
if isarray( a( i ) ) then
|
||||
res = res & makeflat( a( i ) )
|
||||
else
|
||||
res = res & a( i ) & separator
|
||||
end if
|
||||
next
|
||||
makeflat = res
|
||||
end function
|
||||
|
||||
public function flatten( a )
|
||||
dim res
|
||||
res = makeflat( a )
|
||||
res = left( res, len( res ) - len(separator))
|
||||
res = split( res, separator )
|
||||
flatten = res
|
||||
end function
|
||||
|
||||
public property let itemSeparator( c )
|
||||
separator = c
|
||||
end property
|
||||
end class
|
||||
Loading…
Add table
Add a link
Reference in a new issue