Solved

VB Implode function?

Posted on 2004-08-26
5
4,078 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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 In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

749 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