RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Explode ?

Nova

Wanderer
Explode ?

Hi,
is there a function that works like Explode in PHP ?
It works like that:
[code:1]
$var = "Hello I am a dumbass";
$var = explode(" ", $var);
//returns an Array:
//Index 0: Hello
//Index 1: I
//Index 2: am
//Index 3: a
//Index 4: dumbass
[/code:1]
You give the Function a string and a letter (in this case a " " <- Space)
And it will split up your string into an array...splitted by this letter

Is there any Function in C# that works like that ?

-Nova
 
T

Trajlin01

Guest
*blink, blink* ...erhmm... well you see.... *runs away*

(has 0 knowledge with C#, havent escaped from C++ yet)
 

Quinox

Sorceror
var = var.split(' ');

I dont know if this will actually work, since it returns an array which you are assigning to a string variable. *shrugs* But, yeat, somehow its var.split('char');
 

Zippy

Razor Creator
string mystr = "Hello I am a dumbass";
string[] exp = mystr.Split( ' ' );

exp[0] = "Hello"
exp[1] = "I"
etc etc
 
Top