?
Solved

VB Implode function?

Posted on 2004-08-26
5
Medium Priority
?
4,137 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 1600 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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