Solved

VB.NET equivalent of split() or explode()

Posted on 2007-03-24
4
5,325 Views
Last Modified: 2012-05-05
What is the Visual Basic .NET equivalent of PHP's split() or explode() function?

More info: split() and explode() take a string and split it into array components based on another string.

Given a string named $a: "super;really;seriously"
And given command: split($a,";");
An array would be produced: $b[0]="super", $b[1]="really", $b[2]="seriously"
0
Comment
Question by:richdiesal
  • 3
4 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 125 total points
ID: 18787013
split is the same in vb.net...

strData="super;really;seriously"
arrData=strData.Split(strData,";")

Now arrData(0) would equal "super", arrData(1) would equal "really", etc...
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18787015
Perhaps the explode is the same as Join in vb.net? (joins the array back together...)
0
 
LVL 9

Author Comment

by:richdiesal
ID: 18787035
Aha!  I was treating it as a function instead of a method - and explode is the same as split.  Thanks!
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18787039
:)
Glad I could be of assistance... (since I can only spell PHP - haha!)
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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

679 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