Visual Basic 6 function "implode"

Go back

Below you'll find the source for the Visual Basic 6 function implode.

Attribute VB_Name = "modImplode"
' This function is downloaded from:
' You may freely distribute this file but please leave all comments, including this one, in it.
' @Author Stefan Thoolen <>

Option Explicit

' Places an array in a string, with a delimiter char
' Same syntax as the PHP function 'implode'
' See also:
' @param    String  glue        This string must be placed between all pieces
' @param    Variant pieces      An array containing all pieces
' @return   String              All pieces glued and combined
' @author   Stefan Thoolen <>
Public Function implode(glue As String, pieces() As Variant) As String
    ' I wrote this function but later I discovered the built-in function join()
    ' I kept this for compatibility reasons
    implode = Join(pieces, glue)
End Function