Connecting Tech Pros Worldwide Forums | Help | Site Map

explode() equivalent in .net

the friendly display name
Guest
 
Posts: n/a
#1: Jul 22 '05
Hello,

In PHP there is the explode() function, it splits a string and returns an
array consistent of the string parts. The string is split this way:

$pizza = "piece1;piece2;piece3;piece4;piece5;piece6";
$pieces = explode(";", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2

In the above example, the semicolon is declared as separator, the function
splits the string when it encounters it.

Full tutorial:
http://www.php.net/manual/en/function.explode.php


So, my question is very simple: Is there a method in .net, that does similar?

Jon Skeet [C# MVP]
Guest
 
Posts: n/a
#2: Jul 22 '05

re: explode() equivalent in .net


the friendly display name
<thefriendlydisplayname@discussions.microsoft.co m> wrote:[color=blue]
> In PHP there is the explode() function, it splits a string and returns an
> array consistent of the string parts. The string is split this way:[/color]

Sounds like String.Split matches the description.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
the friendly display name
Guest
 
Posts: n/a
#3: Jul 22 '05

re: explode() equivalent in .net


Omg, what was I thinking?

It is the good old split function. No help needed. Sorry for the time steal.
Closed Thread