Solved

VB Implode function?

Posted on 2004-08-26
5
4,091 Views
Last Modified: 2008-01-16
PHP has an implode function with concatenates an array with a given delimeter to a string. This is the exact opposite of the Split() function in VB. Does VB have a similar function?

Example:
array[1] = Bob
array[2] = Fred
array[3] = Mary

implode (array, ",") returns: Bob,Fred,Mary

-Curious Dr. Damnit
0
Comment
Question by:DrDamnit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 6

Accepted Solution

by:
bkthompson2112 earned 400 total points
ID: 11906976
Hi DrDamnit,

use the Join function

from MSDN:

Join(sourcearray[, delimiter])

The Join function syntax has these named arguments:

sourcearray Required. One-dimensional array containing substrings to be joined.
delimiter Optional. String character used to separate the substrings in the returned string. If omitted, the space character (" ") is used. If delimiter is a zero-length string (""), all items in the list are concatenated with no delimiters.

bkt
0
 
LVL 6

Expert Comment

by:bkthompson2112
ID: 11906984
0
 
LVL 15

Assisted Solution

by:Colosseo
Colosseo earned 100 total points
ID: 11906986
Hi Dr

the implode is the same as join in vb

so

arrnames(0) = "Bob"
arrnames(1) = "Fred"
arrnames(2) = "Mary"

join(arrnames,",")

would return

Bob,Fred,Mary

HTH

Scott
0
 
LVL 32

Author Comment

by:DrDamnit
ID: 11917269
First in time, is first in right. Thanks to both of you!
0
 
LVL 6

Expert Comment

by:bkthompson2112
ID: 11917950
You're welcome.  Thanks for the 'A'
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question